Archiv der Kategorie ‘Linux‘

 
 

Ubuntu: Create own or fix broken samba shared directorys

ubuntu_logoI recently wanted to create a shared folder with the attribute hidden, but did not want to change the /etc/samba/smb.cnf.

So i searched where the shares created by the gnome folder-properties window where saved. The directory is:

/var/lib/samba/usershares/

This is also the place, where you might fix a broken share by deleting the config file.

Kubuntu: Connect to hidden WLAN

kubuntu_logo
Somehow the Network-Manager in Kubuntu can not connect to hidden wireless lan. But i found a simple workaround in the kubuntuforums.net:


Den ganzen Beitrag lesen...

Linux: Count lines of code

linux-logo
I found a cool programm, that can count lines of code for several programming languages.
You can find it here: http://cloc.sourceforge.net/


Den ganzen Beitrag lesen...

Ubuntu: Backup/Copy network settings in Ubuntu

ubuntu_logoI did a clean install of Ubuntu 11.04 and copied all the needed configs from my old 10.10 installation. But i could not find the needed folders for the network and wireless settings, so i searched for them and this is what i found.

Den ganzen Beitrag lesen...

Linux: Slow dd because of default blocksize

linux-logoToday is backed up my SSD so i can install Ubuntu 11.04 fearlessly.
Problem was that dd was very slow, but i found a solution.

Den ganzen Beitrag lesen...

Ubuntu: Install on a Disk with less than 4.4 GB (Workaround)

ubuntu_logoI tried to install Ubuntu 11.04 on a 4 GB USB-Stick today, but was failed by the installer who wants at least 4.4 GB free space. This is unnecessary much, because a normal Ubuntu install will stay below 2.5 GB.
I found a "fix" that works like this:

Den ganzen Beitrag lesen...

Linux: Change timezone on Debian/Ubuntu

Change timezone on your Ubuntu/Debian system by opening a Terminal and run this command:

sudo dpkg-reconfigure tzdata

Bash: Simple HDD/SSD speed test using dd

terminal-icon-100x100
I wrote a (very) short script to test hdd or ssd speed using dd. You can find the code here:

hdd-speed-test-1gb.sh
and as text:
hdd-speed-test-1gb.sh.txt

The script uses dd and /dev/zero for writing a 1GB sized tempfile. Then the tempfile is written by dd to /dev/null. dd produces some output where the transfer speed is mentioned. Afterwards the tempfile is removed.
It is really just a tiny script, so i do not have to remember the dd syntax every few months.

Bash: Remove all .svn folders - Un-checkout from svn

If you want to send somebody parts of your svn repository, then you mostly do not want to give them your .svn folders with all the settings and base files inside.

I wrote a short command to remove all the .svn folders recursive from the current directory:

for dir in $(find . -name ".svn" -type d); do rm -rf "$dir"; done

find . -name ".svn" -type d
- Will list recursive all directorys named '.svn' in current directory.

for dir in $(...); do rm -rf "$dir"; done
- Will delete all items from the result of $().

If you do not want to type and remember that much, you can easily add this as a bash alias.
Open your .bashrc and add this line:

alias unsvn='for dir in $(find . -name ".svn" -type d); do rm -rf "$dir"; done'

The next time you start a bash, you have a new command "unsvn".

Bash: Rename all files inside current directory

Renaming all files inside a directory can be done with the following code.

find * -type f | while read FILE; do mv "$FILE" old_"$FILE"; done;

The code will take all filenames in the current directory, and append "old_" to the name.

find * -type f
- Will make a list of all files in the current directory.
while read FILE; do ...; done
- Will read from a list each line into the variable FILE.
mv "$FILE" old_"$FILE";
- Will rename the filename in the variable $FILE to old_$FILE. Check out the double quotes - they are important, otherwise filenames with spaces will break the move command.