-----------------------------------------------
-------------------- sound --------------------
-----------------------------------------------
#
# snd_hda_intel
# 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
#
cat /etc/modprobe.conf
... options snd-hda-intel model=dell-m42
init 3
for i in `lsmod | awk '$0 ~ /snd/ {print $i}'`;do modprobe -rf $i;done
modprobe snd_hda_intel
#
# flash sound
#
rpm -Uhv libflashsupport
#
# disable pulseaudio
#
rpm -e alsa-plugins-pulseaudio
-----------------------------------------------
------------------- iwlwifi -------------------
-----------------------------------------------
#
# 0c:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection (rev 61)
#
$ tail -1 /etc/sysconfig/network-scripts/ifup-wireless
... wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B -f
$ chkconfig NetworkManager off
-----------------------------------------------
-------------------- fonts --------------------
-----------------------------------------------
#
# why do defaults fonts suck so baddddd
#
$ rpm -Uhv http://rpm.livna.org/livna-release-8.rpm
$ yum install liberation-fonts
$ yum install freetype-freeworld
2007-12-01
fedora 8 dell d630
2007-09-11
Hello Python
Hello Python, this is derived from "Ruby in 20 Minutes"1
Enter the python interpreter.
---------------------------------
Define a function that says 'hello world'.
>>> def h():
... print "hello world"
...
>>> h()
hello world
Define a slightly more complex function that says hello to the passed name.
>>> def h(name):
... print "Hello %s!" % name
...
>>> h('Guido')
Hello Guido!
Define a function that says hello to the world, or to the passed name.
>>> def h(name = 'World'):
... print "Hello %s!" % name
...
>>> h()
Hello World!
>>> h('Guido')
Hello Guido!
If we want our object to remember our name, we would use a class. Enter the 'Greeter' class.
>>> class Greeter:
... def __init__(self, name = "World"):
... self.name = name
... def say_hi(self):
... print "Hello %s!" % self.name
... def say_bye(self):
... print "Goodbye %s. Please come again." % self.name
...
>>> g = Greeter('Guido')
>>> g.say_hi()
Hello Guido!
>>> g.say_bye()
Goodbye Guido. Please come again.
>>> g.name
'Guido'
>>>g.name = 'Syn'
>>> g.say_hi()
Hello Syn!
Now for fun lets write a 'MegaGreeter' that can handle multiple names.
>>> class MegaGreeter:
... def __init__(self, name = "World"):
... self.name = name
... def say_hi(self):
... if isinstance(self.name, list) or isinstance(self.name, tuple):
... for i in self.name:
... print "Hello %s!" % i
... else:
... print "Hello %s!" % self.name
... def say_bye(self):
... if isinstance(self.name, list) or isinstance(self.name, tuple):
... print "Goodbye %s. Please come again!" % ", ".join(self.name)
... else:
... print "Goodbye %s. Please come again!" % self.name
...
>>> mg = MegaGreeter(['Guido', 'Syn', 'Ninja'])
>>> mg.say_hi()
Hello Guido!
Hello Syn!
Hello Ninja!
>>> mg.say_bye()
Goodbye Guido, Syn, Ninja. Please come again!
>>> mg = MegaGreeter()
>>> mg.say_hi()
Hello World!
>>> mg.say_bye()
Goodbye World. Please come again!
>>> dir(MegaGreeter)
['__doc__', '__init__', '__module__', 'say_bye', 'say_hi']
2007-08-21
freebsd: setuid core
$ sysctl kern.sugid_coredump=1
kern.sugid_coredump: 0 -> 1
$ sysctl kern.corefile="/var/coredumps/%N/%P.core"
kern.corefile: /var/coredumps/%N/%P.core -> /var/coredumps/%N/%P.core
$ mkdir /var/coredumps/[process name]
$ chown [process owner] /var/coredumps/[process name]
%N = process name
%P = process id
from core
kern.sugid_coredump: 0 -> 1
$ sysctl kern.corefile="/var/coredumps/%N/%P.core"
kern.corefile: /var/coredumps/%N/%P.core -> /var/coredumps/%N/%P.core
$ mkdir /var/coredumps/[process name]
$ chown [process owner] /var/coredumps/[process name]
%N = process name
%P = process id
from core
9 ways to count to 10
$ i=1;while [ $i -lt 11 ];do echo $i; i=$(($i+1));done
$ i=1;until [ $i -eq 11 ];do echo $i; i=$(($i+1));done
$ seq 1 10
$ python -c 'for i in xrange(1,11): print i'
$ perl -e 'for $i (1 .. 10){ print "$i\n";}'
$ ruby -e '(1..10).each {|i| print i,"\n"}'
$ ruby -e '1.upto(10) {|i| puts i}'`
$ ruby -e 'for i in 1..10 do print i, "\n" end'
$ lua -e 'for i=1,10 do print(i) end'
$ i=1;until [ $i -eq 11 ];do echo $i; i=$(($i+1));done
$ seq 1 10
$ python -c 'for i in xrange(1,11): print i'
$ perl -e 'for $i (1 .. 10){ print "$i\n";}'
$ ruby -e '(1..10).each {|i| print i,"\n"}'
$ ruby -e '1.upto(10) {|i| puts i}'`
$ ruby -e 'for i in 1..10 do print i, "\n" end'
$ lua -e 'for i=1,10 do print(i) end'
2007-06-29
the fun continues
/* Convert users input into ascii, hex and decimal. */
I may actually be getting this programming thing down. It started life as a perl script, moved to python, and now its redone in glorious C.
I may actually be getting this programming thing down. It started life as a perl script, moved to python, and now its redone in glorious C.
$ cfun
Usage: cfun [string] [hex] [decimal]
$ cfun syndrowm.com
ascii: syndrowm.com
hex: 73 79 6e 64 72 6f 77 6d 2e 63 6f 6d
dec: 115 121 110 100 114 111 119 109 46 99 111 109
oct: 163 171 156 144 162 157 167 155 56 143 157 155
$ cfun 0x73796e64726f776d2e636f6d
ascii: syndrowm.com
hex: 73 79 6e 64 72 6f 77 6d 2e 63 6f 6d
dec: 115 121 110 100 114 111 119 109 46 99 111 109
oct: 163 171 156 144 162 157 167 155 56 143 157 155
2007-06-22
fedora 7 encrypt a partition
# Encrypt /home
umount /home
$ cryptsetup --verbose --verify-passphrase luksFormat /dev/sda3
WARNING!
========
This will overwrite data on /dev/sda3 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
Command successful.
$ cryptsetup luksOpen /dev/sda3 /home
$ mkfs.ext3 -j /dev/mapper/home
$ cat /etc/cryptab
home /dev/sda3 none
$ grep home /etc/fstab
umount /home
$ cryptsetup --verbose --verify-passphrase luksFormat /dev/sda3
WARNING!
========
This will overwrite data on /dev/sda3 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
Command successful.
$ cryptsetup luksOpen /dev/sda3 /home
$ mkfs.ext3 -j /dev/mapper/home
$ cat /etc/cryptab
home /dev/sda3 none
$ grep home /etc/fstab
#LABEL=/home /home ext3 defaults 1 2
/dev/mapper/home /home ext3 defaults 1 2
fedora 7 and sucky ATI drivers
******* Resolution issues/ATI driver issues **************
ati-fglrx driver has issues with xorg reporting version 1.6
Can't we all just get along?
1) downgrade xorg here
$ rpm -U --oldversion xorg-x11-server-Xorg-1.2.0-6.fc7.i386.rpm
2) tell yum not to upgrade xorg
$ exclude=xorg-x11-server-Xorg*
3) create xorg.conf
$ aticonfig --initial
4) update /etc/X11/xorg.conf
...................
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "LCD Panel 1600x1200"
HorizSync 31.5 - 90.0
VertRefresh 60.0 - 60.0
Option "dpms"
EndSection
Section "Monitor"
Identifier "aticonfig-Monitor[0]"
ModeLine "1920x1200" 154.0 1920 1968 2000 2080 1200 1203 1209 1235 +hsync -vsync
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
Option "IgnoreEDID" "true"
EndSection
Section "Device"
Identifier "aticonfig-Device[0]"
Driver "fglrx"
Option "MonitorLayout" "LVDS,AUTO"
Option "VideoOverlay" "off"
Option "OpenGLOverlay" "on"
Option "mtrr" "off"
EndSection
Section "Screen"
Identifier "aticonfig-Screen[0]"
Device "aticonfig-Device[0]"
Monitor "aticonfig-Monitor[0]"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1920x1200" "1680x1050" "1280x1024"
EndSubSection
EndSection
ati-fglrx driver has issues with xorg reporting version 1.6
Can't we all just get along?
1) downgrade xorg here
$ rpm -U --oldversion xorg-x11-server-Xorg-1.2.0-6.fc7.i386.rpm
2) tell yum not to upgrade xorg
$ exclude=xorg-x11-server-Xorg*
3) create xorg.conf
$ aticonfig --initial
4) update /etc/X11/xorg.conf
...................
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "LCD Panel 1600x1200"
HorizSync 31.5 - 90.0
VertRefresh 60.0 - 60.0
Option "dpms"
EndSection
Section "Monitor"
Identifier "aticonfig-Monitor[0]"
ModeLine "1920x1200" 154.0 1920 1968 2000 2080 1200 1203 1209 1235 +hsync -vsync
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
Option "IgnoreEDID" "true"
EndSection
Section "Device"
Identifier "aticonfig-Device[0]"
Driver "fglrx"
Option "MonitorLayout" "LVDS,AUTO"
Option "VideoOverlay" "off"
Option "OpenGLOverlay" "on"
Option "mtrr" "off"
EndSection
Section "Screen"
Identifier "aticonfig-Screen[0]"
Device "aticonfig-Device[0]"
Monitor "aticonfig-Monitor[0]"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1920x1200" "1680x1050" "1280x1024"
EndSubSection
EndSection
Subscribe to:
Posts (Atom)