This feed contains pages in the "tips" category
I know the "git tips" meme is over, but I found this in git-fetch(1) and, as I find it extremely useful, I'm posting it.
Just add these lines to your ~/.gitconfig:
[url "git+ssh://git.debian.org/git/"]
insteadOf = alioth: Then, if you need something from collab-maint, just usegit clone alioth:collab-maint/repo.git, easy!
P.S.: I did not include my username in the URL because I have it set up in ~/.ssh/config.
EDIT: the above line needs a "=", not a ":" after "insteadOf". Thanks to those commenting!
[lang_it]Un problema abbastanza comune potrebbe essere il dover "circondare" un insieme di linee con altro testo. Facciamo un esempio: vogliamo creare dei tag a partire dai file contenuti in una directory, così da creare facilmente una sorta di "galleria di immagini" da mettere online.[/lang_it][lang_en]One of the most common problems might be "enclosing" a bunch of lines with some other text. Let's do an example: we want to create some
tags from files in a directory, so to easily create an "image gallery" to be put online.[/lang_en] [code]$ ls bar.png buz.png foo.png $[/code]
[lang_it]Come fare ad avere una lista dei file, con i tag ? "Semplice": utilizziamo un po' di sed magic![/lang_it][lang_en]How could we have a list of the files, with
?"Easy": use some sed magic![/lang_en] [code]$ ls > files $ cat files bar.png buz.png foo.png $ sed -i 's/^(.*)$/
/g' files $ cat files
$[/code] [lang_it]Semplice, no? :)[/lang_it][lang_en]Easy, uh? :)[/lang_en]
[lang_it]Per chi usa GNU/Linux, grep è uno dei comandi fondamentali. Se state cercando una parola dentro un file con linee molto lunghe, come fate a vedere il risultato della vostra ricerca immediatamente? È difficile. Ecco perché coloriamo grep ;-)[/lang_it][lang_en]For those using GNU/Linux, grep is a fundamental utility. If you're looking for a word into a file with very long lines, how could you find the result of your search immediately? It's difficult. That's why we're going to give grep some fancy mood ;-)[/lang_en]
[lang_it]Prima di tutto, apriamo ~/.bashrc (o il file corrispondente, se si utilizza una shell alternativa a BASH), ed inseriamo, in un punto qualsiasi (meglio a fine file), le seguenti righe:[/lang_it][lang_en]First of all, let's open ~/.bashrc (or the corresponding file, if you use another shell than BASH), and put, in any point (better if at the end of the file), the following lines:[/lang_en] [code] alias grep="grep --color=auto" export GREP_COLOR="1;33;40" [/code] [lang_it]Dopo questo, torniamo alla shell e diamo il comando source ~/.bashrc, così da rendere attive le nuove impostazioni.[/lang_it][lang_en]After this, let's go back to the shell and give the command source ~/.bashrc, so as to enable the new settings.[/lang_en] [lang_it]E ora, il momento delle spiegazioni. La prima riga dice a Bash di sostituire a "grep" il comando "grep --color=auto". Questo fa sì che grep consideri la variabile d'ambiente GREP_COLOR. Infatti, alla seconda riga, esportiamo questa variabile con il colore che vogliamo. Il formato del "colore" è:[/lang_it][lang_en]And now, the explanation. The first line tells Bash to substitute to "grep" the command "grep --color=auto". This lets grep consider the environment variable GREP_COLOR. In fact, in the second line, we export this variable with the colour we want. The "colour" format is:[/lang_en] attr;foreground;background
- [lang_it]attr è "l'attributo" del testo evidenziato, esso può avere valore 0 (normale), 1 *(grassetto)* e così via;[/lang_it][lang_en]attr** is the "attribute" for the highlighted text, it can be 0 (normal), 1 *(bold)* **and so on;[/lang_en]
- [lang_it]foreground è il colore in primo piano, esso può avere i seguenti valori:[/lang_it][lang_en]*foreground* is the foreground colour of the text, and can be:[/lang_en]
- 30 - [lang_it]nero[/lang_it][lang_en]black[/lang_en];
- 31 - [lang_it]rosso[/lang_it][lang_en]red[/lang_en];
- 32 - [lang_it]verde[/lang_it][lang_en]green[/lang_en];
- 33 - [lang_it]giallo[/lang_it][lang_en]yellow[/lang_en];
- 34 - [lang_it]blu[/lang_it][lang_en]blue[/lang_en];
- 35 - [lang_it]magenta[/lang_it][lang_en]magenta[/lang_en];
- 36 - [lang_it]ciano[/lang_it][lang_en]cyan[/lang_en];
- 37 - [lang_it]bianco[/lang_it][lang_en]white[/lang_en]
- [lang_it]background è il colore di sfondo, e può avere i valori:[/lang_it][lang_en]*background* is the background colour, and can have values of:[/lang_en]
- 40 - [lang_it]nero[/lang_it][lang_en]black[/lang_en];
- 41 - [lang_it]rosso[/lang_it][lang_en]red[/lang_en];
- 42 - [lang_it]verde[/lang_it][lang_en]green[/lang_en];
- 43 - [lang_it]giallo[/lang_it][lang_en]yellow[/lang_en];
- 44 - [lang_it]blu[/lang_it][lang_en]blue[/lang_en];
- 45 - [lang_it]magenta[/lang_it][lang_en]magenta[/lang_en];
- 46 - [lang_it]ciano[/lang_it][lang_en]cyan[/lang_en];
- 47 - [lang_it]bianco[/lang_it][lang_en]white[/lang_en]
[lang_it]L'esempio sopra riportato, quindi, imposta il testo cercato in grassetto, di colore giallo con sfondo nero. Ha un gran risalto sulla mia shell nera! ;-)[/lang_it][lang_en]So the example written above sets the searched text in bold, in yellow with a black background. It shines on my black shell! ;-)[/lang_en] [lang_it]Buon divertimento con grep![/lang_it][lang_en]Enjoy grep![/lang_en]
Who has had problems in seeing fonts in flash movies on Linux using Firefox?
Here is a solution, taken from lot of googleing and several suggestions:
- Install xfs package, that is the X Font Server;
- Install the msttcorefonts package, which contains the Microsoft fonts, used by most of the flash movies;
- Install the ttmkfdir package, which contains the ttmkfdir and mkfontdir utilities, which we will use later.
At this point, we can proceed:
- mkdir -p /usr/X11R6/lib/X11/fs/
- ln -s /etc/X11/fs
- cd /usr/share/fonts/truetype/msttcorefonts
- ttmkfdir
- mkfontdir
With the last two commands, we'll create two files in /usr/share/fonts/truetype/msttcorefonts/: fonts.dir e fonts.scale.
Now we can edit the /etc/X11/fs/config file (or /usr/X11R6/lib/X11/fs/config, they're the same file, as we symlinked them), adding the path of the Microsoft fonts to the catalogue line. For example (your mileage may vary, since this line depends on which fonts you've got on your system) in the case you have:
catalogue = /usr/share/fonts/X11/misc/, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/100dpi/, /usr/share/fonts/X11/75dpi/
you'll need to edit the line so as it becomes:
catalogue = /usr/share/fonts/X11/misc/, /usr/share/fonts/X11/100dpi/:unscaled, /usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/100dpi/, /usr/share/fonts/X11/75dpi/,/usr/share/fonts/truetype/msttcorefonts/
(those paths should stay on a single line)Now we can restart Firefox, and see our flash movies! 
This procedure works on Debian and Debian-based systems. It should nevertheless work also on other systems, paying attention to system path differences.
