Posts Tagged tip
GNOME3 – “Bluetooth is disabled”
Pubblicato da Alessandro Lorenzi in Uncategorized il settembre 12, 2011
Se la finestra della gestione del bluetooth vi dice “Bluetooth is disabled” .. voi provate a dare questi due comandi come utente amministratore
systemctl enable bluetooth.service
systemctl start bluetooth.service
A me ha funzionato
Nuovo codice per invitare tutti gli amici di facebook
Pubblicato da Alessandro Lorenzi in Appunti Vari il marzo 27, 2011
javascript:var elms=document.getElementsByName("checkableitems[]");for(var count=0;count<elms.length;count++){var t = setTimeout("elms["+count+"].click()",100)}
Scaricare tutte le foto di flickr
Pubblicato da Alessandro Lorenzi in Linux, Software il marzo 26, 2011
#!/bin/bash
url= $1
wget "${url}" -O - -o /dev/null | while read line
do
url=`echo $line | grep media:content | grep -E "http://.*.jpg" -o `
if [[ ${#url} -gt 0 ]]
then
title=''
while [[ ${#title} -eq 0 ]]
do
read line
title=`echo $line | grep media:title | grep -o ">.*<" | sed "s/>//" | sed "s/<//"`
done
echo "--------------------------------------"
echo "TITLE: $title"
echo "URL: $url"
wget "${url}" -O "${title}.jpg" -o /dev/null
fi
done
Installare Wavelet Denoise su fedora
Pubblicato da Alessandro Lorenzi in Appunti Vari il marzo 21, 2011
I passi per installare Wavelet Denoise su Fedora 14
# wget http://registry.gimp.org/files/wavelet-denoise-0.3.1.tar.gz # tar xf wavelet-denoise-0.3.1.tar.gz # cd wavelet-denoise-0.3.1 # yum install -y gettext gcc gimp-devel # make # make userintall
Inserire FTP in uno script ksh
Pubblicato da Alessandro Lorenzi in Appunti Vari, programmazione il febbraio 15, 2011
#! /usr/bin/ksh HOST=remote.host.name USER=whoever PASSWD=whatever exec 4>&1 ftp -nv >&4 2>&4 |& print -p open $HOST print -p user $USER $PASSWD print -p cd directory print -p binary print -p put tar.gz print -p bye wait exit 0
That is the file descriptor manipulation. Recall that fd 0 is standard-in, fd 1 is standard-out, and fd 2 is standard-error. The line “exec 4&>1″ opens fd 4 and assigns it to whatever fd 1 was assigned to. As you will see, I am sorta “saving a copy of fd 1 in fd 4″. The line “ftp -nv >&4 2>&1 |&” is a little harder. The “|&” turns the process into a co-process that allows subsequent “print -p” statements to send lines to the co-process’ standard-in and “read -p” to read from its standard-out. So ksh forks a copy of itself and fiddles with the fd’s 0 and 1 until this it set-up. But it leaves the rest of the fd’s alone. Then it encounters “>&4″ which causes it to set the ftp process’ standard out to whatever 4 is. Well since 4 is a copy of 1 before the co-process, we are back to writing to the original shell’s standard out. Lastly, the 2>&4 does the same thing for standard error. I could’ve used “2>&1″ at this point for the same effect. This is hard to explain, but I hope this helps.
Skype plugin per pidgin
Pubblicato da Alessandro Lorenzi in Linux, Uncategorized il gennaio 6, 2011
Oggi ho installato il plugin per utilizzare skype su pidgin.
Installarlo é molto semplice:
Prima di tutto dobbiamo accertarci di avere installato skype e pidgin:
$ pidgin -v Pidgin 2.7.7-1.fc14 (libpurple 2.7.7) $ skype -v Skype 2.1.0.81 Copyright (c) 2004-2009, Skype Limited
Poi copiare il plugin nella directory corretta :
$ mkdir ~/.purple/plugins $ cd ~/.purple/plugins $ wget http://eion.robbmob.com/libskype.so
Ora basta riavviare pidgin tenendo skype chiuso e creare il nuovo utente skype. Al primo avvio skype chiederá se pidgin é autorizzato ad utilizzare le api. Diciamo gli di ricordare la nostra risposta che, ovviamente é si.
Bash, raccogliere argomenti
Pubblicato da Alessandro Lorenzi in programmazione il ottobre 25, 2010
Con getopts é possibile raccogliere gli argomenti con cui viene eseguito uno script.
Ecco un esempio:
#!/bin/bash
LOG_NAME=´/var/log/mylog.log´
DIR=´/tmp/myscript/´
while getopts d:l option
do
case "$option" in
l) LOG_NAME=$OPTARG ;;
d) DIR=$OPTARG ;;
esac
done
ls -la $DIR >> $LOG_NAME

Commenti recenti