Pages

Sunday, 29 April 2012

Openswan configuration files

I wanted to move my openswan ip configuration to my new computer. So this is a short list of the files copied, and actions taken.
sudo apt-get install openswan
I choose not to generate a certificate.
Files needed:
/etc/ipsec.conf
/etc/ipsec.d/certs
/etc/ipsec.secrets
/etc/ipsec.d/private/
Instructions:
ipsec setup --stop
ipsec setup --start
ipsec auto --up connection_name

DWM and java applications

Java applications do not run on dwm, so you need to type:

wmname LG3D
unset AWT_TOOLKIT
./app
Credits should go to these pages:
Jtang
Arch Linux/DWM

Compile DWM on Ubuntu

My Good Friend told me about suckless.org. In the meanwhile, I installed the new Ubuntu version (12.04) on my ssd drive. I was almost happy, but I felt, that this is just too much for me. I don't want to follow the Unity line, I am fed up with the Windows like feeling, I am fed up with the mouse, I want to work with my computer. So let's give a try to a minimalistic approach: dwm.
First, I just did a lazy apt-get install dwm, but after a day, I thought It is a good idea to look at the source code, do some configuration, etc.

hg clone http://hg.suckless.org/dwm
cd dwm
sudo apt-get install libxinerama-dev
sudo make clean install
cat /usr/share/xsessions/dwmcustom.desktop
[Desktop Entry]
Encoding=UTF-8
Name=DwmCustom
Comment=Dynamic window manager
Exec=/usr/local/bin/dwm
Icon=dwm
Type=XSession
That's all you need to have your custom dwm compiled.

Saturday, 28 April 2012

WPA on Linux

I have used Ubuntu's builtin WYSIAYG network manager. At some point I needed some more control over my network interfaces. I wanted a dhcpd to listen on eth0, and wanted my wlan to connect to my router. So I disabled the network manager:
sudo /etc/init.d/network-manager stop
And configuring the wpa:
wpa_passphrase ssid passphrase > /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &
dhclient wlan0

Friday, 6 April 2012

Prepare for SSD installation

I have bought an Intel 520 SSD, and I would like to install it professionally. So some notes to consider:
  • EBS (Erase Block Size) - align partitioning to EBS - I was not able to know what is the EBS, so accoding to the ARCH wiki, I will align my first partition to 1MB (latest fdisk automatically aligns all partitions to 2048 sectors, or 1024 KiB, which should work for all EBS sizes)
  • Filesystem: ext4 with noatime (reads wont modify anything)
  • ext4 with discard option - for TRIM support
  • I will let filesystem to do journalling
  • Check TRIM is working
  • seq 1 1000 > testfile
    sync
    hdparm --fibmap testfile
    testfile:
     filesystem blocksize 4096, begins at LBA 2048; assuming 512 byte sectors.
     byte_offset  begin_LBA    end_LBA    sectors
               0   29868576   29868583          8
    hdparm --read-sector 29868576 /dev/sda
    /dev/sda:
    reading sector 29868576: succeeded
    0a31 0a32 0a33 0a34 0a35 0a36 0a37 0a38
    0a39 3031 310a 0a31 3231 310a 0a33 3431
    ...
    
    rm testfile
    sync
    /dev/sda:
    reading sector 29868576: succeeded
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    ...
    
  • Kernel 2.6.33+ has TRIM
  • Over-Provisioning - I will go for 20% OP (I will have one partition, which consumes 80% of the drive)
  • Change I/O Scheduler to noop or deadline for the ssd device
  • echo noop > /sys/block/sdX/queue/scheduler
 Sources:

Thursday, 5 April 2012

Disable mdadm autodetect

I wanted to create a raid array from USB drives. As USB drives are changing, I don't want mdadm to auto-assemble the arrays during system startup.
[root@alarm ~]# cat /etc/mdadm.conf | grep DEVICE
DEVICE /dev/null