RSS
 

Useful Linux Commands

30 Jan

Mount a temporary file system in memory:

# mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
# mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/

Read more: http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/#ixzz1ktjbieMM

 
 

jQuery Plugin – Image Radio buttons

12 Oct

At work I’ve written this jQuery plugin. It’s only 2KB big and turns your normal radio buttons into images, you can set any images you like for src, checked and hover. Simply attach the configuration to your html input field as the class attribute as a JavaScript like object. I know you might want to attach a class to your radio buttons, but this is how far it currently is.

Here an example:

Get the JavaScript code
Get the HTML/JavaScript code

Edit: Just found this which seems to make this plugin obsolete. :-( Wish I would have found this earlier…

 

Ubuntu on Asus N53S(V)

08 Oct

To install Ubuntu with a working NVIDIA card on this laptop. Follow these instructions:

  1. Follow https://help.ubuntu.com/community/Asus_N53
  2. Add this to your modules blacklist in /etc/modprobe.d/blacklist.conf:
    blacklist nouveau
    blacklist fbcon
    blacklist vga16fb
  3. Run 3D Graphics intensive applications like Google Earth with
    optirun google-earth
  4. Optional: Mount Windows NTFS partition in /etc/fstab:
    /dev/sda5       /d      ntfs    noexec,nosuid   0       0

Edit: You might not need to add the blacklist. I’ve just setup 11.04 64 bit and did not black list the drivers and it works! Remember to NOT enable the additional drivers in this setup because it will override your Intel Drivers, which are good because you can still run 3D apps but with less power consumption.

 
 

My bash settings

09 Sep
export PATH=$PATH:"/cygdrive/c/Program Files/Vim/vim73"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'
 
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi
 
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
 
No Comments

Posted in Settings

 

My VIM Settings

07 Sep
set ignorecase
set tabstop=2
set shiftwidth=2
set autoindent
set expandtab
imap <c-space> <c-x><c-o>
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType css set omnifunc=csscomplete#CompleteCSS

http://shang-liang.com/blog/using-vim-as-actionscript-editor/

 
 

How to backup Windows XP/7 partition with Linux (Ubuntu)

23 Aug

To backup any partition of any file system type with Linux, you can simply run the following command:

dd if=<input_partition> of=&<output_file> bs=<byte_count>

where

<input_partition>:= is the partition you want to backup (this can also be a file if you want to do the reverse). So, e.g. /dev/sda1 for the first partition on the first drive (hence a=drive 1, 1=partition 1, b=drive 2, …).

<output_file> := is the file you want to write the partition to (this can also be the output partition on restore).

<byte_count> := is the size of your file system’s clusters, normally 4096.

dd if=/dev/sda2 of=/d/sda2_partition bs=4096 #for my own reference
tar cvfz sda2_partition.tar.gz sda2_partition # own reference



You can then compress the file using a normal archiver and save a lot of space that way, because dd constructs a file as big as the partition because it reads bit by bit or 4096 bytes multiple times.

 
 

Tim-Hinnerk Heuer Resume

27 Jun

Please view at Tim-Hinnerk Heuer Curriculum Vitae

 
 

Howto: Solving problem with logrotate

25 Dec
/etc/cron.daily/logrotate:
 
error: error running shared postrotate script for /var/log/mysql.log
/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log
 
run-parts: /etc/cron.daily/logrotate exited with return code 1

Have you been getting this cryptic error message before?

Here is how to get rid of it:

View /etc/mysql/debian.cnf. Look for

user     = debian-sys-maint
password = newpass

Log into mysql as root

mysql -uroot -p
SET PASSWORD FOR `debian-sys-maint`@`localhost` = PASSWORD('newpass');
SET PASSWORD FOR `debian-sys-maint`@`%` = PASSWORD('newpass');
FLUSH PRIVILEGES;

Log out and it should be fixed.

 
No Comments

Posted in Howto, Linux

 

Howto: Install XAMPP 1.7.2 on Windows 7 with XDebug and Netbeans

25 Dec

Hi,

Just for my own reference and some other poor people out there trying to get this to work:

  1. Download XAMPP 1.7.2 from sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.7.2/xampp-win32-1.7.2.exe/download
  2. Install
  3. Download php_xdebug-2.0.5-5.3-vc6.dll from xdebug.org/download.php
  4. Place it in C:\xampp\php\ext
  5. Edit C:\xampp\php\php.ini add:
    zend_extension = “C:\xampp\php\ext\php_xdebug-2.0.5-5.3-vc6.dll”[xdebug]

    xdebug.remote_enable=on

    xdebug.remote_host=127.0.0.1

    xdebug.remote_port=9000

    xdebug.remote_handler=”dbgp”

  6. Enjoy!
 
 

Howto: Postfix aliases setup email account

25 Dec

Edit /etc/postfix/virtual.cf .

vim /etc/postfix/virtual.cf

Add line:

user@example.com localusername

postmap /etc/postfix/virtual.cf

vim /etc/aliases

Add line:

localusername: someother@othersite.com

newaliases

 
No Comments

Posted in Howto, Linux