Author Archives: deathadder

Bash Links

File Test Operators

Posted in Bash Tips, Linux | Comments closed

Bash Pitfalls

Very helpful site: http://mywiki.wooledge.org/BashPitfalls

Posted in Bash Tips, Linux | Tagged , | Leave a comment

Splitting Strings in bash

Say you’ve got a pipe ‘|’ separated string; to get each element of it you can use awk. myString=”a|b|c|d” firstElem=$(echo “$myString” | awk ‘{split($0,temp,”|”); print temp[1]}’) firstElem would then contain “a”. Or by using tr: myString=”a|b|c|d” myArray=( $(echo $myString | tr “|” ” “) ) echo ${myArray[0]} # prints a

Posted in Bash Tips, Linux | Tagged , , , , | Leave a comment

Remove Windows EOL characters ^M

If you’ve copied/edited a script from a Windows machine you may get a “bad interrupter” error due to Windows EOL characters seen as ^M, sometimes, in vi. To remove them you can use sed like so: $ sed ‘s/^M//g’ Win_File > Unix_File To get ^M you’ll need to enter ‘Ctrl-V Ctrl-M’. You can do the [...]

Posted in Bash Tips, Linux | Tagged , , , , | Leave a comment

Configure PAN to use SSL

Pan, a GTK news reader does not support SSL connects itself, which means if you want to connect to a news server using SSL you will have to setup a SSL tunnel. To do this you will need to install stunnel, I’m going to assume you have already installed stunnel and wish to know how [...]

Posted in Linux, Software | Tagged , , , , | Leave a comment

Uninstalling Software

Here I will explain the ways to uninstall software you installed via source code, Debian and Red Hat packages. To remove software you’ll need to run the commands below as the root user. Source code (tar.gz / tar.bz2) Debian Packages (debs) Red Hat Packages (rpms) Source code To uninstall from source it is easiest to [...]

Posted in Linux, Software | Tagged , , , , , , , , | Leave a comment

Installing Software

There are a number of ways to install software within Linux using the command line, you can compile the source code yourself, or use a precompiled binary. Here I plan on explaining how to install software using the main methods, these are: Source code (tar.gz / tar.bz2) Debian Packages (debs) Red Hat Packages (rpms) However [...]

Posted in Linux, Software | Tagged , , , , , , , | 1 Comment