Remove all unused kernels in debian based systems

http://www.unixmen.com/remove-all-unused-kernels-with-1-command-in-debian-based-systems/ sudo apt-get remove $(dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`) If it doesn’t work, try this: dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge http://www.commandlinefu.com/commands/view/10520/remove-all-unused-kernels-with-apt-get

OpenWRT Boot from USB device

http://www.nslu2-linux.org/wiki/OpenWRT/BootFromUsbDevice This guide covers fast (12mbit/s) USB and ext2 filesystem only. Make sure you install package kmod-usb2 and load module ehci-hcd or your disk will be (very, hdparm -t < 12,5mbit/s) slow. This tutorial is for OpenWRT (kamikaze, backfire) with 2.6 kernel, but it will probably work for other devices too running OpenWRT on a ... Read more

How to setup OpenVPN with bridging on OpenWRT

http://wiki.openwrt.org/doc/howto/vpn.openvpn opkg update opkg install openvpn openvpn-easy-rsa Or if you prefer configure openvpn via GUI: opkg install luci-app-openvpn /etc/easy-rsa/vars export EASY_RSA="/etc/easy-rsa" export OPENSSL="openssl" export PKCS11TOOL="pkcs11-tool" export GREP="grep" export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA` export KEY_DIR="$EASY_RSA/keys" echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR export PKCS11_MODULE_PATH="dummy" export PKCS11_PIN="dummy" export KEY_SIZE=1024 export CA_EXPIRE=3650 … Read more

Samba server and client configuration in Debian

http://www.debianhelp.co.uk/samba.htm http://julien.herbin.ecranbleu.org/samba_client_howto/ Samba server configuration apt-get install samba samba-client Check an smb.conf configuration file for internal correctness. testparm Look what services are available on a server. smbclient -L //server -U username /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = %h server (Samba %v) dns proxy = no log file = /var/log/samba/log.%m max log size = … Read more

HOWTO: NFS Server/Client

http://ubuntuforums.org/showthread.php?t=249889 I found using NFS just as easy if not easier than using Samba for sharing between a few of my Unix based systems. In order to share a folder it only required a single line in a configuration file under /etc/exports, and a single line under /etc/fstab on the client to mount the share … Read more

How to install Linux Mint from the USB stick

http://community.linuxmint.com/tutorial/view/744 Using the Terminal It is really simple. Go to a Terminal and type: sudo dd if=~/Desktop/linuxmint.iso of=/dev/sdx oflag=direct  bs=1048576 Where ‘~/Desktop/linuxmint.iso’ is the name and location of your downloaded image (located at the desktop in this example) and ‘/dev/sdx’ is the target USB drive. If your system doesn’t support ‘oflag=direct’, you can just leave it … Read more

SSH Server configuration

Change following settings: /etc/ssh/sshd_config Port 22 Protocol 2 PermitRootLogin no RSAAuthentication yes PubkeyAuthentication yes PermitEmptyPasswords no X11Forwarding yes UsePAM yes UseDNS no

Set up the Firewall Using UFW

http://1000umbrellas.com/2010/04/29/how-to-set-up-the-firewall-using-ufw-on-ubuntu-lucid-lynx-server Today I learned a different way to configure the firewall on my Ubuntu / Debian Server: the ufw command. UFW stands for “Uncomplicated FireWall” and it’s just that. It provides a simpler interface to add or remove firewall rules to iptables, the default Linux firewall. It’s installed on Ubuntu Server by default. To set … Read more

Setup CUPS (Common UNIX Printing System) Server and Client in Debian

http://www.debianadmin.com/setup-cups-common-unix-printing-system-server-and-client-in-debian.html The Common UNIX Printing System™, or CUPS, is the software you use to print from applications like the web browser you are using to read this page. It converts the page descriptions produced by your application (put a paragraph here, draw a line there, and so forth) into something your printer can understand and … Read more

Gallery 3 installation / upgrade in Ubuntu

Installation aptitude install apache2 mysql-server-5.1 su – www-data cd /var/www/user wget http://downloads.sourceforge.net/gallery/gallery-3.0.4.zip unzip gallery-3.0.4.zip mv gallery3 gallery rm gallery-3.0.4.zip cd gallery mkdir var chmod 777 var exit mysql -u root -p SHOW DATABASES; SELECT User FROM mysql.user; CREATE DATABASE `user-gallery3`; CREATE USER `user-gallery`; SET PASSWORD FOR 'user-gallery' = PASSWORD('mysecretpassword'); GRANT ALL PRIVILEGES ON `user-gallery3`.* TO … Read more