Year: 2012
-
Todo.txt – Insert repeating tasks v1
(Not tested extensively). A script to add todo’s to todo.txt. Add a crontab each dat at 0:00 with the following script: #!/bin/bash SCHEDFILE=$HOME/todo/scheduled.txt TODOFILE=$HOME/todo/todo.txt # Look for all date types in scheduled for RAWDATE in $(egrep -o “^[a-zA-Z]*” $SCHEDFILE); do # Format date types for date DATESTR=” for str in $RAWDATE; do DATESTR+=”%$str”; done #…
-
Use a new ttf font in Fedora 17
First, find the dir you can put the font: $ grep dir /etc/fonts/fonts.conf . If it lists ~/.fonts , create the /home/username/.fonts dir Put the ttf file in the ~/.fonts directory < Rescan: $ fc-cache done.
-
Split an image into multiple images
1. Install imagemagick 2. $ convert originalimage.png -crop 100%x50% +repace output-page.png
-
Disable terminal window border in fallback mode
-edit- this only works for gnome with compiz $ ccsm go to window border type the following in ‘Decoration windows’: !(class=Gnome-terminal)
-
Force fallback for gnome 3
Do: $ dbus-launch gsettings set org.gnome.desktop.session session-name ‘gnome-fallback’
-
Opera better ctrl-tab (without pop-up)
Go to opera:config, search for ‘Window Cycle Type’, change to 2
-
Dropbox problem on Fedora 16, 64 bit, not responding
I had this: /home/karlo/.dropbox-dist/libz.so.1: version `ZLIB_1.2.3.3′ not found (required by /usr/lib64/libxml2.so.2) Failed to load module: /usr/lib64/gio/modules/libgvfsdbus.so And the icon did not show the sync-arrows. Disabling proxies worked for me. Right-click the db icon, settings, … you’ll find it.
-
Slow down fan speeds (less noise) on Fedora with Nouveau (default) driver
Add this to your commandline: nouveau.perflvl_wr=7777 Will allow you to change the fan speed. After a reboot, change fan speed by; # echo 40 > /sys/class/drm/card0/device/pwm0 I put the following in the root crontab to monitor temperature: * * * * * test `cat /sys/class/drm/card0/device/temp1_input` -gt 75000 && echo 100 > /sys/class/drm/card0/device/pwm0 || echo 10…
-
Multiple JPGs to one single PDF (Linux/Fedora)
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 :)
-
Useful ‘command not found’ output for bash
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…
-
Focus follows mouse in gnome fallback
gconftool-2 –type string –set /apps/metacity/general/focus_mode mouse OR: Install ccsm Run it Go to general options Click ‘focus and raise behaviour’ Untick ‘raise to focus’ Now the windows will focus on hovering the mouse over it.
-
[SOLVED] Add date (and seconds) to GNOME3 bar/clock
$ 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
-
Use ssh-agent for multiple terminal windows
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.
-
Fedora focus follows mouse
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
-
[SOLVED] Install native spotify on Fedora (with Spotify apps)(64bit+32bit)
This cost me some hours to find out, but I am currently using the native spotify linux preview under fedora 16, 64 bit: Steps: Make sure you don’t use spotify free. It will not work on linux. Install some things: $ sudo yum install qt-webkitย perl-ExtUtils-MakeMaker libXScrnSaver nspr-devel openssl-devel For 64 bit, do: $sudo ln -s…
-
Use document title and document date in lyx fancyheader
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: a temporary directory (for temporary files)
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
-
Import mp3 in audacity (on fedora)
Remove audacity (#yum remove audacity), install audacity-freeworld (#yum install audacity-freeworld ). That’s it. You might have to enable RPMFusion.
-
Encrypt Dropbox content easily on Linux/BSD/OSX using encfs
Install encfs do $mkdir ~/Dropbox/Secure ; mkdir ~/DropboxSecure do $ encfs ~/Dropbox/Secure ~/DropboxSecure I chose paranoia mode. This will use the settings below. 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…
-
Sleep better by installing one simple program
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…
-
Easily setting up a ThePirateBay.org mirror (wordpress plugin)
Easier than my previous post, use this plugin for wordpress.
-
Easily setting up a ThePirateBay.org mirror (nph-tpb.cgi)
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…
-
Example postfix + dovecot SSL configuration
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…
-
[Solution] Can’t use /usr/lib/dovecot/imap: No such file or directory
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 ;)
-
Update wordpress without needing FTP
Give your wordpress dir the right permissions: sudo chmod -R 775 wp-dir ; sudo chown -R username:www-data Add this in wp-config.php:ย define(‘FS_METHOD’,’direct’); You can now update via ‘update now’.
-
Test SMTP block (sshguard, fail2ban)
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