JLinX – Blog

Weblog von Jan Linxweiler

OS X Run Shell Scripts From Finder

Filed under: Apple & Mac OS X,Linux — Jannis at 9:40 pm on Sunday, November 23, 2008
  1. Rename the shell script extension from .sh to .command
  2. Make the file executable: chmod +x file.command
  3. Wherever you put the file, it will run with your home directory as the current working directory. To get around this, use the following line:
    cd “`dirname “$0″`”

How to Search for File Contend in Specific Files

Filed under: Apple & Mac OS X,Linux — Jannis at 9:16 pm on Thursday, November 20, 2008

find . -iname “*.cpp” -print | xargs grep “main(” -s

-s = silent – no error messages

SSH Tunnel

Filed under: Apple & Mac OS X,Linux — Jannis at 9:26 pm on Tuesday, November 11, 2008

ssh -N -L 4001:destination.machine.de:3389 user@gateway.machine.de

Forward local port 4001 to gateway.machine.de, and tell him to send this to destination.machine.de, on port 3389

-N tells ssh to only handle tunnel, we do not want a shell on this host
-L specifies the kind of tunnel (Local port forwarding)
4001 is the local port to use
destination.machine.de is a host hidden by the firewall
3389 is the port you want to reach.
user is the user you want to connect as.
gateway.machine.de is the public server you will jump by.

How to Split Files Under Linux

Filed under: Linux — Jannis at 9:25 am on Friday, April 4, 2008

split -C 700m file.tar

cat part.* > file.tar

How to Install Code::Blocks on Ubuntu (Feisty)

Filed under: Development,Linux — Jannis at 9:14 pm on Thursday, March 6, 2008
  • Add ‘deb http://apt.wxwidgets.org feisty-wx main‘ to your APT repositories
  • Run ‘sudo apt-get update’
  • Get codeblocks_8.02-0ubuntu1.deb.tar.gz from www.codeblocks.org and unpack
  • Install all Code::Blocks debian packages by runnig ‘sudo dpkg -i *deb’

How to Install Darwin Calendar Server on Ubuntu

Filed under: Apple & Mac OS X,Linux — Jannis at 1:01 pm on Friday, February 22, 2008

How to Use CUDA on Linux in Emulation Mode

Filed under: Development,HPC,Linux — Jannis at 5:11 pm on Tuesday, February 19, 2008
  1. Get CUDA Toolkit version 1.1, CUDA SDK version 1.1 for Linux and NVIDIA Driver for Linux with CUDA Support from NVIDIAs CUDA Zone.
  2. Install the Toolkit and the SDK as root by executing the *.run files.
  3. Add the location of the CUDA binaries (nvcc) to your PATH environment variable and the location of the CUDA libraries to your LD_LIBRARY_PATH environment variable:
  4. If you have no NVIDIA card installed you need to extract the libcuda.so library from the Driver bundle by executing the driver’s .run file with the option
    Copy the /lib/*.so files of the driver packages to the other CUDA libraries (/usr/local/cuda/lib).
    Add a symbolic link:
    ‘sudo ln -s libcuda.so.169.09 libcuda.so’
    (In my case the lib is named “libcuda.so.169.09”. It my be different on your system.)
  5. Go to the SDK directory and run make with emulation option enabled:
    ‘make emu=1’ or ‘make emu=1 dbg=1′ for debug mode
  6. Run the examples in ./bin/linux/emurelease …  


How How to install Qt to a specific directory

Filed under: Apple & Mac OS X,Development,Linux — Jannis at 10:59 pm on Monday, January 21, 2008

If you want to install Qt into a specific user directory you can configure you build as followed:
./configure -prefix /home/username/Qt

On OS X you can also set the “-universal” flag

How to Use "rm" Together with "find"

Filed under: Linux — Jannis at 9:37 pm on Friday, January 11, 2008

How to delete several directories (or files) that you discovered with the find command?

find . -iname “dir name” -print0 | xargs -0 rm -r

How to Search for Files Under Linux

Filed under: Linux — Jannis at 11:38 am on Thursday, January 10, 2008

find . -iname “expression

Next Page »