Arxiu de la categoria: Miniposts

Aquesta categoria és per a aquelles entrades que m’interesa que estiguin arxivades al blog però que no les considero prou importants per a que surtin a la portada.

xuleta pdftk

Un recordatori d’algunes de les funcions del programa pdftk. També hi ha disponible una interfí­cie grí fica, GUIPDFTK.


Unir dos o més PDFs en un document nou.

pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf


pdftk *.pdf cat output combinados.pdf

Extreure pí gines de diferents documents i combinar-les.

pdftk A=uno.pdf B=dos.pdf cat A1-7 B1-5 A8 output combinado_especial.pdf

Codificar un PDF amb una paraula de pas forta.

pdftk midocumento.pdf output midocumento-codificiado.pdf owner_pw password123


pdftk midocu-codificado.pdf input_pw pasword123 output docu-descodificado.pdf

Unir dos arxius, un d’ells codificat.

pdftk A=docu-codificado.pdf otrodocu.pdf input_pw A=password123 cat output combinado2.pdf

Descomprimir el text d’un document PDF.

pdftk midocumento.pdf output midocumento.simple.pdf uncompress

Reparar un document PDF (si és possible).

pdftk documento-dagnado.pdf output documento-corregido.pdf

Font: Mikrotecnologias – La super herramienta para PDF.

Copies de seguretat per correu (

Aquesta és una macro per a l’ per a enviar documents per correu electrònic de manera “silenciosa”.

Sub SendMailBackup()
Dim MailAddress As String, MessageSubject As String
Dim ThisDocURL As String, DocDir As String, FileName As String
Dim MailAgent As Object, MailClient As Object, MailMessage As Object, ThisDoc As Object
Dim Args()
If ThisDoc.hasLocation=False Then
MsgBox "You must save the document first!" :End
End If
If ThisDoc.isModified Then
ThisDoc.storeAsURL(ThisDocURL, Args)
End if
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
End If
DocDir=DirectoryNameoutofPath(ThisDocURL, GetPathSeparator())
FileName=Dir(ThisDocURL, 0)
MessageSubject="[OOO_DOC_BACKUP] " & FileName & " " & CDateToISO(Date) & " - " &_
Hour(Time)& ":" & Minute(Time) & ":" & Second(Time)
If GetGUIType=1 Then
End If
MailClient.sendSimpleMailMessage(MailMessage, 1)
End Sub

Font: – OooBasic crash course: One-click email backup of documents

integrar el calendari de google amb el de GNOME

Aquest és un truc per integrar el calendari de Google Calendar amb el calendari de GNOME sense fer servir evolution, encara que requereix tenir el paquet evolution i evolution-server instal·lats. També pot fer-se sevir amb qualsevol calendari en format iCalendar.

/usr/libexec/evolution-webcal $URL

on $URL representa l’adreça en format webcal: del calendari que volem afegir.

Font: Bryan Clark – Mashing Google Calendar and GNOME

Checklist per a bloggers principiants

The only thing that matters

Well, may not be the ONLY thing but want to stress on the importance anyway
The only thing that matters finally is superior content. If you forget everything else in this list and focus on just providing great content, you can still win BIG in the blogging world!

Things to do on your blog

1. Enable search on your blog

Again, search should be a standard feature for any website. Your blogging provider would normally provide the feature. You just have to find out how to enable it for your blog.

2. Link to your profile

Write up your introduction “elevator pitch” and link it from your blog. People want to know who you are. Celebrity bloggers can ignore this comment :)

3. Provide a way to contact you

Other than posting comments on your blog, provide a way (email, phone or both) for your readers to connect with you. I have made quite a few new friends from all over the world.

4. Create meaningful categories and chunk content

Very soon you will have a lot of content on your blog and your readers will get confused where to go. One option is to create meaningful categories and file content appropriately. That will be a great service for your readers.

5. Put your photo on the home page

Blog is a conversation that you are having with your readers and it becomes more personal with a photo.

Things to do off your blog

1. Register a domain name and redirect it to your blog

It costs less than $10 per year but the return on investment is huge.

2. Include your blog link in your email signature

Again, it takes only a minute but it will help spread the message quickly.

3. Build your personal brand

Your brand can help your blog and your blog can help your brand. So start building your personal brand right away.

Registries and Directories

1. Get a creative commons license for your blog content

Creative Commons makes it easy to assign a license for your online content. I use a license called “Attribution-NonCommercial 2.0”

This means (in english)

You are free to
* to copy, distribute, display, and perform the work
* to make derivative works

Under the following conditions:
* by Attribution. You must attribute the work in the manner specified by the author or licensor.
* Noncommercial. You may not use this work for commercial purposes.

2. Get a feedburner account and direct feeds through feedburner

Most probably your blogging software will automatically provide an RSS feed capability. However, chances are that you may not be able to track how many readers are subscribing (and how they are subscribing) to your feed. By burning your feed via feedburner, you can get those statistics. Again, it only takes a few minutes to setup a free account on feedburner.

3. Implement subscription chiclets

People use variety of RSS readers and you want to make it easy for them to subscribe to your feed from those RSS readers. Feedburner provides scripts to create those subscription chiclets. I suggest that you should take a look at the available options and add those chiclets to your blog site.

4. Claim your blog on technorati

By registering yourself at technorati and claiming it, you have an ability to put your photo with your profile. When people search for stuff on technorati and your blog comes up in the search results your thumbsize photo appears with the search result. Every single thing helps.

5. Provide email subscriptions to your blog

You will be amazed how many people want to read your blog via their email. It’s easy to set that up. You can get a script to do that by registering at Feedblitz.

6. Link to your photo album

If you have an online photo album with a service like Flickr, put in a link to that as well.

7. Announce your blog to the world

The first thing that you can do is to use a service like Pingomatic to ping a few servers. Of course, best would be to write compelling content that would make others link to your site.

8. Link to your online bookmarks

If you have an account with and are tracking some interesting websites, you can link to your bookmark page.

9. Validate your feeds

Simple way is to subscribe to your own feed in your RSS readers. Other way is to use FeedValidator to check if everything is OK

10. Geo-tag your blog

Feedmap provides a simple way of associating your physical co-ordinates (city, zip) to your blog. As more people sign up for this service, your blog will appear in the “bloggers nearby” for your neighbours blogs.

11. Claim your blog at Feedster

You claimed your blog at Technorati. Now, please go ahead and claim it in Feedster as well. If you do well, you might even get into the feedster elite club “Feedster Top 500” :) You can add an icon or your photo to personalize the search results

12. Register your blog at Findory

Findory aggregates some of the finest blogs and they recommend content based on users’ interest. So if a user is reading an article in another blog that has similar content, he or she may be presented with your blog to consider reading.

13. Register at Blogwise

Blogwise is a directory that is created manually by a bunch of cool folks. You can submit your blog for inclusion and someone over there will add it to the directory if they find the content appropriate. You can check out the listing for Life Beyond Code and may be leave your comments on this blog there.

14. Register in the TTLB ecosystem

TTLB (The Truth Laid Bear) eco-system ranks blogs by links.

15. Register at Blogarama

Blogarama is another manually moderated registry.

16. Get Clustrmaps for your blog

Show visitor count and the regions from where the visitors are coming

17. Enable MyBlogLog click tracking

MyBlogLog is really cool. It takes about 2 minutes to implement on your blog and provides real-time tracking (Pro Version) of user behavior (where did they come from and where did they go) on your blog.

18. Publish your conversations from other blogs to your blog via CoComment

Succeeding in blogging requires participating in conversations. How do you bring all your conversations in one place? Well, CoComment has an answer via their Firefox plugin.

19. Leverage the power of HitTail to get more traffic

HitTail reveals in real-time the least utilized, most promising keywords hidden in the Long Tail of your natural search results. We present these terms to you as suggestions that when acted on will boost the natural search results of your site. It’s that simple.

20. Give back some link love with WhoLinked

WhoLinked will search through the web and send you back a list of sites that are linking to your site. You can say “thank you” to those sites by putting up this widget.

21. Provide target website previews via Snap Preview

Snap Preview Anywhere enables anyone visiting your site to get a glimpse of what other sites you’re linking to, without having to leave your site. By rolling over any link, the user gets a visual preview of the site without having to go there, thus eliminating wasted “trips” to linked sites.

22. Get cool widgets from MajikWidget

Do you want to add polls, voting or rating for your blog? Check out cool widgets from Majikwidget. You can get them for a song.

23. Register in BlogTopSites

BlogTopSites is a directory of blogs. Register your blog under the right category.

Font: Blogging Starter Checklist (Rajesh Setty a Squidoo)

Calcular la lletra del NIF (en PHP)

El Numero d’Identificació Fiscal (NIF) espanyol es composa del número del Document Nacional d’Identitat (DNI) més una lletra. Aquesta lletra es calcula dividint el número del DNI per 23 i la resta que queda és un nombre entre l’1 i el 22 que equival a la lletra.

Aquí­ copio el codi php per calcular-ho.

# #
function LetraNIF ($dni) {
/* Obtiene letra del NIF a partir del DNI */
$valor= (int) ($dni / 23);
$valor *= 23;
$valor= $dni - $valor;
$letraNif= substr ($letras, $valor, 1);
return $letraNif;


Configuració del touchpad ALPS (linux)

Això és una nota mental per a ternir sempre a ma el bocí­ de l’arxiu etc/xorg.conf (o etc/X11/xorg.conf segons la distribució) que configura correctament els touchpads Alps, com ara el del Toshiba Qosmio G20.

Section "InputDevice"
        Identifier     "Synaptics Touchpad"
        Driver  "synaptics"
        Option "SendCoreEvents" "true"
        Option "Device" "/dev/psaux"
        Option "Protocol" "auto-dev"
        Option "HorizScrollDelta" "0"
        Option "SHMConfig" "true"
	Option "LeftEdge" "130"
	Option "RightEdge" "840"
	Option "TopEdge" "130"
	Option "BottomEdge" "640"
	Option "FingerLow" "7"
	Option "FingerHigh" "8"
	Option "MaxTapTime" "180"
	Option "MaxTapMove" "110"
	Option "EmulateMidButtonTime" "75"
	Option "VertScrollDelta" "20"
	Option "HorizScrollDelta" "20"
	Option "MinSpeed" "0.25"
	Option "MaxSpeed" "0.50"
	Option "AccelFactor" "0.030"
	Option "EdgeMotionMinSpeed" "200"
	Option "EdgeMotionMaxSpeed" "200"
	Option "UpDownScrolling" "1"
	Option "CircularScrolling" "1"
	Option "CircScrollDelta" "0.1"
	Option "CircScrollTrigger" "2"
	#always usefull
	Option "Emulate3Buttons" "true"

fsck ext3

Si utilitzeu particions ext2/ext3 sota windows (com ara amb el driver Ext2IFS), sempre existeix el risc quan es penja el windows es produeixin errors d’escriptura al disc. En aquests casos hi ha 2 solucions possibles:

  • 1. Muntar les particions en linux per tal que el driver ext2/3 integrat al kernel intenti solucionar automí ticament els errors.
  • 2. Reparació manual:
    init 1
    fsck.ext3 -y /dev/sda1

    NOTA: ext3 és el sistema d’arxius de la partició i /dev/sda1 és la partició amb problemes.