Yet another useless blog

[ Home | RSS 2.0 | ATOM 1.0 ]

Mon, 14 Jan 2013

Notes on haskell

this is just a short list of things i should remember about haskell:
  1. definitions are immutable
  2. ++ is slow, has to walk the hole list. : is fast
  3. infix/prefix functions
  4. !! fetches on element by index ( [1,2,3] !! 2 -> 2 )
  5. strings are lists of chars
  6. when comparing lists, the next elements are only compared if the previous elements were equal ( [3,2,1] > [2,10,100] -> True )
  7. lists: head/tail/last/init
  8. lists II: length/null/reverse/take/drop/maximum/minimum/product/elem
  9. lists support steps: [3,6..20]
  10. lists III: cycle/repeat
tuples:
  1. must now in advance how many elements
  2. can contain combination of types (1, "hello")
  3. list of tuples must contain tuples of the same type
  4. fst/snd only work on tuples with two elemnts
  5. zip
pattern matching:

posted at: 18:46 | path: /computer | permanent link to this entry

Wed, 09 Jan 2013

building openvswitch 1.7.1 under rhel/centos 6.3

as we are testing openstack and openvswitch we needed an openvswitch package. but it is currently only available for fedora 17/18 and not RHEL6 or CENTOS 6. so i hacked together these two src rpms: this patch is required to build openvswitch 1.7.1. it's already included in the srpm above. the kernel module is only required for rhel/centos 6, fedora comes with the module installed. you are also going to need the following rpm's installend

posted at: 15:49 | path: /computer/unix | permanent link to this entry

Fri, 28 Dec 2012

Configuring a brand new HP 2510G

  1. per default the switch uses DHCP to acquire an in-band mgmt ip address, look for an arp table entry that starts with 28:92:4a, thats your switch. You have to ping the switch first of course...
  2. telnet to the ip address the switch got (e.g. telnet 10.0.0.2 )
  3. you instantly become manager (note the # at the end of the prompt
  4. enter setup
  5. assign a manager password and change the snmp public community string
configuring ssh access:
  1. login to the switch via telnet and enter manager mode (enable)
  2. enter config mode
  3. assign an operator password. you can also specify the username for the operator user: password operator user-name admin
  4. create a ssh keypair: crypto key generate ssh rsa
  5. take a look at the keys: show crypto host-public-key
  6. enable ssh access: ip ssh
  7. show ssh status: show ip ssh
  8. finally login to the switch via ssh: ssh admin@10.0.0.2
configure a static ip
  1. show the current ip config show ip
  2. set a static ip: vlan 1 ip address 192.168.0.253/24
  3. set the default gateway: ip default-gateway 192.168.0.254
saving the configuration
  1. just execute: write memory<

posted at: 20:35 | path: /computer/network | permanent link to this entry

Mon, 05 Nov 2012

rhev 3.0 api examples using python

found on github.

posted at: 16:51 | path: /computer | permanent link to this entry

Tue, 25 Sep 2012

awk one-liner to get username, gecos and lv size of users

works with gnu awk
awk -F: '/s[0-9]/ { cmd=sprintf("/usr/sbin/lvs --unit m --noheadings -o lv_size /dev/rootvg/%slv",$1); (cmd | getline result); printf("%s \"%s\" %s\n",$1,$5,result)}' /etc/passwd

posted at: 15:06 | path: /computer | permanent link to this entry

Mon, 24 Sep 2012

how to build a archlinux custom kernel

because of a kernel oops on my brand new lenovo x230, i had to try a -rc kernel before reporting this as a bug. this is short reminder on how i did this
$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux ; git archive --format=tar --prefix=linux-3.6-rc7/ v3.6-rc7 | gzip > ../linux-3.6-rc7.tar.gz
$ pacman -S abs
$ cd ~/tmp/ ; ABSROOT=. abs core/linux
$ cd core/linux; vi PKGBUID
i had to change to following lines in PKGBUILD:
pkgbase=linux-pinhead
_srcname=linux-3.6-rc7
pkgver=3.6rc7
source=("$_srcname.tar.gz"
        ...)
then rebuild all md5 sums
$ makepkg -g
and paste the output into the PKGBUILD file. finally create a new pkg:
$ makepkg

posted at: 20:59 | path: / | permanent link to this entry

Sun, 16 Sep 2012

an emacs lisp introduction

An introduction to elsip

posted at: 21:09 | path: /computer | permanent link to this entry

Thu, 06 Sep 2012

apple on shell script security

sounds strange, nevertheless useful apple on shell script security

posted at: 00:00 | path: /computer | permanent link to this entry

Mon, 03 Sep 2012

All watched over by machines of loving grace

All watched over by machines of loving grace. couldn't find a downloadable version of the movie above. but thanks to fefe here's an online version.

posted at: 00:00 | path: / | permanent link to this entry

Sat, 01 Sep 2012

First post!

restartet blogging and moved to pyblosxom.

posted at: 00:00 | path: / | permanent link to this entry

Thu, 01 Jan 1970

bluetooth pairing under debian

wvdial configuration:
[Dialer Defaults]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
FlowControl = NOFLOW
Init1 = ATZ
Init2 = ATM0

[Dialer umts]
Username = ppp@A1plus.at
Password = ppp
Phone = *99***1#
Stupid Mode = 1
Init3 = AT+CGDCONT=1,"IP","A1.net"
Dial Attempts = 3

posted at: 00:00 | path: /computer | permanent link to this entry

PowerPC G5

very interesting article about the PowerPC G5 CPU

posted at: 00:00 | path: /computer/hardware | permanent link to this entry

iCal

Project24 is _very_ useful.
now i have all austrian holidays, time of sunrise / sunset and all
moon phases in my ical/palm.

posted at: 00:00 | path: /computer | permanent link to this entry

git push into non bare repository


my blog entries are managed via git. normally i git-push changes form a checked-out version to my webserver, where the blog is hosted. problem is, after the push the checkout-out files are not automatically updated. One solution is to use a third bare git repo to push into, but there's another way

git push to a non-bare repository

posted at: 00:00 | path: /computer | permanent link to this entry

debian with kvm

posted at: 00:00 | path: /computer | permanent link to this entry

#freebsd

10:55 27.09.2004 < miqorz> my eyes hurt. perhaps I should i wear my glasses o_O
10:55 27.09.2004 < pandzilla> miqorz: just place an aquarium in front of your monitor

posted at: 00:00 | path: /computer/irc | permanent link to this entry

secure startupitems

after reading a paper on this page, i created the following
script (/etc/daily.local)
#!/bin/sh

chown -R root:wheel /Library/StartupItems 
chmod -R og-w /Library/StartupItems 

posted at: 00:00 | path: /computer/mac | permanent link to this entry

socat

nifty little utility

posted at: 00:00 | path: /computer/network | permanent link to this entry

wlan with linksys and airport express


the last few days i spent most of my spare time configuring my wireless network. a few weeks ago i bought a linksys wrt54gs wireless accesspoint. it's really a nice peace of hardware but coverage is a little bit low. to have full wireless access in my hole flat i had to extend the wlan via a second ap. being a little apple fan (writing this entry on my 15'' powerbook) i bought an airport express. regarding this review, wds should work between the linksys and the airport. following the instructions in this blog it worked out quite well.
next step was security. first i was using wpa enterprise via the linksys router. but if you are using wds, wpa will not work. so i had to change my config to ipsec. thanksfully to apple configuring ipsec between a freebsd gateway and os x is not a problem at all. os x uses the freebsd network stack, so the config files can be copied. the NetBSD IPSEC FAQ was very valuable.
my racoon.conf and my ipsec.conf. don't be too disappointed if i'm not showing my psk.txt file.

UPDATE

i forgot to mention that wds will not work with the linksys standard firmware. you have to get this one.

posted at: 00:00 | path: /computer/network | permanent link to this entry

dotfiles


after reading this article, i started to pull my dotfiles into cvs.
i am a long time cvs user (mainly for scripts, documentation and that stuff),
and always wanted to manage my dotfiles with cvs.

now, i have a cvs project dotfiles, with a corresponding entry in CVSROOT/modules:
dotfiles        -o .dotfiles/cvsfix -d .dotfiles        dotfiles/
here you find the cvsfix script.
next step will be a public accessible cvs-repository so i can share my dotfiles.

to be continued...

posted at: 00:00 | path: /computer | permanent link to this entry

zsh

in the never ending search for the perfect shell, i am now learning zsh.
bought the book From Bash to Z Shell, looks promising to me.
skimmed through the first chapter which is very basic (what is a shell,
what are unix processes, entering commands,...). hopefully
the next chapters will be more technical.

this site is very useful. thanks michael, for your well documented .zshrc

posted at: 00:00 | path: /computer/unix | permanent link to this entry

zshrc and zshenv


finally my zshrc and zshenv. be aware this is work in progress...

posted at: 00:00 | path: /computer/unix | permanent link to this entry

Made with Pyblosxom