2012
05.09

so i recently got my hands on an adamo 13″ black and decided to put gentoo on it. pretty straight forward.

after everything was installed i wanted to play some music through the headphones, and no sound came out..

so after a little googling this is what resulted :
cat /proc/asound/card0/codec#0 | egrep Codec
which gave me :
Codec: IDT 92HD73C1X5

weird…. i would have figured that an intel hd would be straight forward.

so after getting the codec i referenced kernel.org’s HD audio documentation and did a grep for “92HD73″ which lead me to this section:

STAC92HD73*
===========
  ref		Reference board
  no-jd		BIOS setup but without jack-detection
  intel		Intel DG45* mobos
  dell-m6-amic	Dell desktops/laptops with analog mics
  dell-m6-dmic	Dell desktops/laptops with digital mics
  dell-m6	Dell desktops/laptops with both type of mics
  dell-eq	Dell desktops/laptops
  alienware	Alienware M17x
  auto		BIOS setup (default)

so i added:
options snd-hda-intel model=dell-m6 to the end of /etc/modprobe.d/alsa.conf.

rebooted…and confirmed working….

kernel config for 3.3.4

2012
04.30

so this is one of those things that you forget about when you really need it.

ssh sessions dies, now to kill the session….

don’t remember how ???

neither do i most of the time.

type ~ and ? (thats a tilde then question mark)

which gives you this :

$ ~?
Supported escape sequences:
  ~.  - terminate connection (and any multiplexed sessions)
  ~B  - send a BREAK to the remote system
  ~C  - open a command line
  ~R  - Request rekey (SSH protocol 2 only)
  ~^Z - suspend ssh
  ~#  - list forwarded connections
  ~&  - background ssh (when waiting for connections to terminate)
  ~?  - this message
  ~~  - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

so the break would be ~.

2012
04.17

i like checking my email with mutt and pine, but for this article i am posting the section of my .muttrc that lets me use my google mail (@pissedoffadmins.com for this example) :

set imap_user = "USER@pissedoffadmins.com"
set imap_pass = "PASSWORD"
set smtp_url = "smtp://USER@smtp.gmail.com:587/"
set smtp_pass = "PASSWORD"
set from = "USER@pissedoffadmins.com"
set realname = "USER"
set folder = "imaps://imap.gmail.com:993"

just change all the uppercase parts to what you need it set to.

since i do not have profiles configured yet i set up aliases in my bashrc to open mutt using the -F flag.

my .muttrc in github
my .bashrc in github

2012
04.06

at time of writing, gentoo TuxOnIce is at sys-kernel/tuxonice-sources-3.0.26 and gentoo sources is at sys-kernel/gentoo-sources-3.3.1.

so after compiling tuxonice-sources (here is my .config for reference) and configuring all the hibernate / suspend scripts referenced here i realized that after resuming from either suspend to ram or hibernating to swap that my function keys were borked.

after doing some googling, it turns out that its a known bug with tuxonice and thinkpads for the function keys to no longer work on resume.

so i decided to just customize a gentoo-sources kernel to support suspending-to-ram and hibernating-to-swap using the thinkpad function keys.

here is my customized .config using a solid foundation from pappy from the gentoo forums. this kernel also has some modified acpi / power configs to help maximize the battery life.

if you decide to use my configurations, make sure that you have sys-power/acpid emerged and set to start on boot or default, and also have sys-power/hibernate-script emerged for all the hibernate and suspend functionality.

now i have a thinkpad that suspends and hibernates without the need of the TuxOnIce patches and works just the same.

here is the bug i found concerning thinkpads and tuxonice even though it says fixed, i have still had issues with it. it could just be use flag vanilla with TuxOnIce, but this was way easier to implement.

2012
04.06

so after using my thinkpad x60 for a while i realized that my battery (brand new) was dying to quickly, to start testing i installed powertop (Gentoo: sys-power/powertop, other : http://www.lesswatts.org/projects/powertop/) and started to notice that there were some changes at the kernel level and other minor tweaks that i could do to maximize on my battery.

Here is the kernel .config tweaked with a good foundation from pappy who is awesome on the Gentoo forums with tweaking out kernels. i recomend that you do a diff between my .config, pappy’s .config, and the .config that comes from portage to see the differences.

at the time of writing, current sys-kernel/gentoo-sources was 3.3.1.

some of the other tweaks that i did (after some googling and using powertop) were :
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
iwconfig wlan0 power timeout 500ms

which after said and done, when my battery is fully charged it went from about 1.75 hours to 3.5 hours (give or take a couple of minutes).

2012
04.05

so i realized that with the setup i have that i did not have a detailed battery indicator on my thinkpad except for the battery light, so i decided to use acpi (gentoo: sys-power/acpi, or sourceforge).

by just typing acpi (with the laptop unplugged) you get :
Battery 0: Discharging, 99%, 02:58:51 remaining

while plugged in (says unknown since it is not charging while at 99%):
Battery 0: Unknown, 99%

here it is with a charging message:
Battery 0: Charging, 93%, 00:11:07 until charged

so i changed my right status bar from:
set -g status-right '#[fg=red]Up #(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=black]#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'

to:
set -g status-right '#[fg=green,bold]#(acpi -V | head -n 1 ) #[fg=red,bold]#(cut -d " " -f 1-4 /proc/loadavg) #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'

which looks like:

in green bold is acpi
in red bold is cut -d " " -f 1-4 /proc/loadavg
in cyan bold is %Y-%m-%d %H:%M:%S

link to my tmux.conf at github

2012
04.04

Sessionlist

This is a tool written by rage of some notoriety here at pissedoffadmins.

Sessionlist : HTTP is a simple protocol, and many use it to create “program-like” websites. With asynchronous requests available in almost every browser (including mobile ones) it’s no surprise that many people create a zillion and one sites for almost any purpose. The underlying issue with HTTP is that it is stateless. How do you create the illusion of program state in a naturally stateless protocol? The correct answer is to create a new protocol that is designed for this purpose however that didn’t happen. Instead we have silly hacks that allow us to pretend to have state while using HTTP. How is this accomplished? Well, we pass variables and their values back and forth with every single request! It will cause overhead but they’re websites not real programs! To make this more manageable many web scripting languages support sessions which can reduce the overhead by storing a session id in browser cookies instead of all the variables/values and use the session id to look up server stored variable/values. Of course now all you need to facilitate authentication is the session id.

his work can be found here or on http://securitytube-tools.net

2012
03.19

so, after compiling a new kernel from gentoo sources (3.2.11) and a restart, my trusty old x60 freezes during boot with the last message being:

init-early.sh used greatest stack depth

hmm

after a little googling, i stumbled across this bug.

so, here is what i did in a nutshell to get my machine back up and running (remember, this is just one fix):
boot off of a minimal install disk
# mount /dev/sda3 /mnt/gentoo
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

now run fdisk -l to find the path to the boot partition which in my case looks like :

# fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5f51a82e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400   83  Linux
/dev/sda2          206848     8595455     4194304   82  Linux swap / Solaris
/dev/sda3         8595456   488397167   239900856   83  Linux

now lets mount boot also
# mount /dev/sda1 /boot

now, make your way to /usr/src/linux and vi your .config file
look for:
CONFIG_DEVTMPFS
which in my case said:
# CONFIG_DEVTMPFS is not set
now lets change it to:
CONFIG_DEVTMPFS=y

now, compile your kernel how you normally would and use the new bzImage file.

that fixed my situation, YMMV.

2012
03.16

so as all 2 or 3 of you know, i like updating my screenshots of whatever phone i happen to be using at that time.

since i have plans to upgrade to the nexus prime soon, this will be the last screenshot of this phone:

its worked well, and as you can see i have 4.0.3 but am still using adw as my launcher.

2012
03.13

for the two or three of you that read this and follow, i am starting to put all the dotfiles and scripts that are on this site in github at here