June 25, 2009, 11:14 am
If during an lftp session you get the error message:
get: Access failed: 521 Data connections must be encrypted. (xxx.tar.gz)
You will need to set this variable:
lftp username@host.com:/> set ftp:ssl-protect-data true
May 14, 2009, 3:12 pm
If you ever need to grep some specific tags in a bunch of pdf files, you can use the following one liner, e.g:
for FILE in $(find /home/user/Desktop/downloads/ -name "*.pdf" 2>/dev/null -mtime -1 \! -type d -exec ls {} \;); do pdftotext $FILE - | grep -o 'BZ [0-9]\{5\}';done
April 24, 2009, 4:43 pm
I get the following error when executing a binary file:
error while loading shared libraries: libcrypto.so.4: cannot open shared object file: No such file or directory
This error is likely to occur either because you have not properly defined your $LD_LIBRARY_PATH or the file is simply missing.
To debug try the following:
ldd {binary_file}
or to get more verbose information:
export LD_DEBUG=libs;{binary_file}
for more options:
export LD_DEBUG=help;{binary_file}
April 18, 2009, 4:47 pm
Encrypt the file:
openssl des3 -salt -in file.txt -out encrypted_file.txt
Decrypt the file:
openssl des3 -d -salt -in encrypted_file.txt -out decrypted_file.txt
April 15, 2009, 1:57 pm
If you are a command line addict, you can download shell-fm and start listening Last.fm from there.
Links to customize it:
http://jdin.blogspot.com
http://shell-fm.wikidot.com/extending-shell-fm
April 14, 2009, 3:17 pm
“The transaction log in database tempdb is almost full. Your transaction
is being suspended until space is made available in the log.”
If you are getting this error message you can extend tempdb running the following commands:
disk init name ="extra_tempdb", physname ="/opt/sybase/data/extra_tempdb", vdevno=8, size=512000
alter database tempdb on extra_tempdb = 500
alter database tempdb log on extra_tempdb = 500
March 27, 2009, 2:36 pm
fsniper allow to monitor your folders and trigger some actions based on the type of files you have there.
Example: ~/.config/fsniper/config
PDF files downloaded from Firefox on the desktop, get moved to ~/Desktop/pdf.
watch {
~/Desktop {
*.part {
handler = echo ignoring file: %%
}
application/pdf {
handler = mv %% ~/Desktop/pdf
}
}
}
Fsniper can be run in daemon mode:
fsniper --daemon
March 12, 2009, 12:39 pm
Add group with specfic id:
# groupadd -g {gid} {group}
Add existing user to existing group:
# usermod -G {group} {username}
Check to which group a user belong:
# id -nG {username}
Remove existing user to existing groups (group1,group2,group3.group4), e.g remove it from group3:
# usermod -G {group1,group2,group4} {username}
March 11, 2009, 5:07 am
mysqldump --opt --where="true LIMIT 1000000" mydb > mydb1M.sql
mysqldump --opt --where="true LIMIT 1000000" mydb mytable > mydb_mytable_1M.sql
mysql -p mydb_1 < mydb1M.sql
March 10, 2009, 1:02 pm
sqlplus user/password@db
SQL> set echo off
SQL> set feed off
SQL> set head off
SQL> spool analyze_tables.sql
SQL> select ‘analyze table ‘||table_name||’ compute statistics;’ from user_tables;
SQL> spool off
SQL> exit
sqlplus user/password@db @analyze_tables.sql