karlo

 

Found here: http://blog.hacka.net/#post49

# yum install install ImageMagick pdftk
$ cd jpgdir; for FILE in *.jpg; do convert $FILE -compress JPEG $FILE.pdf; done; pdftk "*.pdf" cat output allPages.pdf

:)

 

Add this to your .bashrc:

clippy() { echo "I see you're trying to use the terminal …"; echo " v "; echo " ╭─╮"; echo " ⌾ ⌾"; echo " │▕│"; echo " ╰─╯"; }
function command_not_found_handle { clippy $1; }

It will result in:

$ adsf
I see you're trying to use the terminal …
v
╭─╮
⌾ ⌾
│▕│
╰─╯

Looks better in the terminal.

 

Use dbus-launch before your command.

 
  1. Install ccsm
  2. Run it
  3. Go to general options
  4. Click ‘focus and raise behaviour’
  5. Untick ‘raise to focus’

Now the windows will focus on hovering the mouse over it.

 

$ gsettings list-recursively | grep gnome.shell.clock
org.gnome.shell.clock show-date false
org.gnome.shell.clock show-seconds false

Set via:
$ gsettings set org.gnome.shell.clock show-date true
$ gsettings set org.gnome.shell.clock show-seconds true

 

This script by user ‘kwall’ works well for the ssh-agent. Add ssh-add before the last ‘fi’ to add the default ssh keys into it as well.

 

Tuto here

Only follow:
gconftool-2 –type string –set /apps/metacity/general/focus_mode mouse

Also raise:
gconftool-2 –type boolean –set /apps/metacity/general/auto_raise true
gconftool-2 –type string –set /apps/metacity/general/auto_raise_delay 600

 

This cost me some hours to find out, but I am currently using the native spotify linux preview under fedora 16, 64 bit:

Steps:

  1. Make sure you don’t use spotify free. It will not work on linux.
  2. Install some things: $ sudo yum install qt-webkit perl-ExtUtils-MakeMaker libXScrnSaver nspr-devel openssl-devel
  3. For 64 bit, do: $sudo ln -s /usr/lib64/libssl.so /usr/lib64/libssl.so.0.9.8
  4. For 32 bit, $ sudo ln -s /usr/lib/libssl.so /usr/lib/libssl.so.0.9.8
  5. Find the latest spotify deb. At the time I write this, this is located here. Find the latest version here.
  6. Convert the .deb to .rpm using Alien. Instructions here. It will create a .rpm
  7. Install : $ sudo rpm -Uvh –nodeps /path/to/your/rpm

If it complains about .so files not existing:

  1. For example, it looks for ‘libsmime3.so.1d’
  2. Search for ‘libsmime3.so’ in your lib-dir. For 64-bit, this is /usr/lib64. For non-64-bit, it is probably /usr/lib/: $ ls /usr/lib64/libsmime3.so
  3. Symlink this to the file spotify is searching for: sudo ln -s /usr/lib64/libsmime3.so /usr/lib64/libsmime3.so.1d
  4. Repeat this about 10 times. Maybe you can find all the missing links by soing this: $ ldd /usr/bin/spotify | awk ‘{print $1}’ | xargs ls 1>/dev/null

If you get a segfault:

  • I got a segfault (segmentation fault) with the native linux client, solved by using a later build. Find the latest one at one of the links above
  • Find out why it segfaults by using $ldd spotify , enter ‘run’ and you will get output

Error 409 means you need a subscribtion.

If spotify crashes at startup, clear the caches:  $ rm -r {.cache,.config}/spotify

Symlinks I made:

cd /usr/lib64
sudo ln -s libnss3.so libnss3.so.1d
sudo ln -s libnssutil3.so libnssutil3.so.1d
sudo ln -s libsmime3.so libsmime3.so.1d
sudo ln -s libplc4.so libplc4.so.0d
sudo ln -s libnspr4.so libnspr4.so.0d
sudo ln -s /usr/lib64/libssl.so /usr/lib64/libssl.so.0.9.8
sudo ln -s libcrypto.so libcrypto.so.0.9.8

 

Put this in your Lyx preamble (document -> settings -> preamble):


\def\title#1{\gdef\@title{#1}\gdef\THETITLE{#1}}
\def\date#1{\gdef\@date{#1}\gdef\THEDATE{#1}}
\def\author#1{\gdef\@author{#1}\gdef\THEAUTHOR{#1}}

\usepackage{fancyhdr}
\pagestyle{fancy}
\newcommand{\helv}{%
\fontfamily{phv}\fontseries{b}\fontsize{10}{10}\selectfont}
\lhead{\helv \THETITLE - \THEDATE }
\rhead{\helv \THEAUTHOR}

\usepackage{lastpage}
\cfoot{\thepage\ / \pageref{LastPage}}

 

My tip: make a temporary directory for all kinds of random stuff. Downloads, quick notes et cetera. I use it a lot. By using a crontab like this, the old files (+5 days) are automatically deleted:

$ find /home/karlo/temp/ -type f -mtime +5 -delete && find /home/karlo/temp/ -empty -delete

 

Remove audacity (#yum remove audacity), install audacity-freeworld (#yum install audacity-freeworld ). That’s it. You might have to enable RPMFusion.

 
  1. Install encfs
  2. do $mkdir ~/Dropbox/Secure ; mkdir ~/DropboxSecure
  3. do $ encfs ~/Dropbox/Secure ~/DropboxSecure
  4. I chose paranoia mode. This will use the settings below.
  5. Enter a secure password and there you go.

You now have a folder ‘DropboxSecure’, in which you can store your sensitive data. It will save this in ~/Dropbox/Secure/ .

You can unmount this via $ sudo umount /home/karlo/DropboxSecure #needs to be done using sudo. I guess this is a bug. After umounting, you will notice the directory DropboxSecure is still there, but empty.

Mount again by using step 3 and entering your password.

Paranoia settings: 

Filesystem cipher: “ssl/aes”, version 3:0:2
Filename encoding: “nameio/block”, version 3:0:1
Key Size: 256 bits
Block Size: 1024 bytes, including 8 byte MAC header
Each file contains 8 byte header with unique IV data.
Filenames encoded using IV chaining mode.
File data IV is chained to filename IV.
File holes passed through to ciphertext.

Screenshot:

 

Redshift adjusts the color temperature according to the position of the sun. A different color temperature is set during night and daytime. During twilight and early morning, the color temperature transitions smoothly from night to daytime temperature to allow your eyes to slowly adapt. At night the color temperature should be set to match the lamps in your room. This is typically a low temperature at around 3000K-4000K (default is 3700K). During the day, the color temperature should match the light from outside, typically around 5500K-6500K (default is 5500K). The light has a higher temperature on an overcast day.

It works very good. I use it like this:

$ redshift -l 52.369:4.891 #amsterdam

http://www.openstreetmap.nl/ can give you your coordinates.

 

 

Easier than my previous post, use this plugin for wordpress.

 

If you want to set up a simple pirate-bay mirror, download this script. This is the nph-tpb.cgi – file various sites talk about.

Setting up is easy. It is just a CGI script. So place it in your CHI-folder (or create one) and  set the directory-settings so it will allow CGI scripts. Sample config is in the download.

 

I generated SSL certs using this guide. Then I set up dovecot and postfix. View my dovecot conf here and my psotfix main.cf here.

You can use this to configure your own working SSL mail. Remember to install: dovecot, dovecot-imap and postfix.

On your devices, use ports 143/993 (incomping) and 587 (outgoing).

Please note my main.cf file also includes config for mailman.

 

Getting this?

$ sudo service dovecot restart
* Restarting IMAP/POP3 mail server dovecot
Error: mail_executable: Can’t use /usr/lib/dovecot/imap: No such file or directory
Fatal: Invalid configuration in /etc/dovecot/dovecot.conf
…fail!

install dovecot-imap ;)

 
  1. Give your wordpress dir the right permissions: sudo chmod -R 775 wp-dir ; sudo chown -R username:www-data
  2. Add this in wp-config.php: define(‘FS_METHOD’,'direct’);

You can now update via ‘update now’.

 

I used the following script to test brute-force protection:

#!/usr/bin/php
<?php

for( $i=0; $i<99; $i++ ){
echo “Will try [$i] now. \n”;
$mbox = imap_open(“{mail.mailserver.com:143/imap/novalidate-cert}INBOX”,”user_test_$i”,”foobar”,0,0);
}

?>

 

Edit: You will need php-cli and php-imap

 

Found this gem on an other blog:

Deprecated Linux networking commands and their replacements 

I mostly use $ifconfig. Let’s try `$ ip a` from now on :) .

© 2011 Karlo Luiten Suffusion theme by Sayontan Sinha