Archive for the 'Scripts / Code' Category

Conky in kde 4.4.4

Yep, it works! and it looks great too. I pulled the latest version of conky and made some minor tweaks to get it working properly.

[ebuild   R   ] app-admin/conky-1.8.0  USE="X curl imlib ncurses portmon rss truetype wifi -apcupsd -audacious -debug -eve -hddtemp -iostats -lua -lua-cairo -lua-imlib -math -moc -mpd -nano-syntax -nvidia -thinkpad -vim-syntax -weather-metar -weather-xoap" 0 kB

As for your conf file, just edit ‘/etc/conky/conky.conf and make this your top section before the ‘TEXT’ area…

background yes
use_xft yes
xftfont Trebuchet MS:size=8
xftalpha 0.9
update_interval 1.0
total_run_times 0
out_to_consoleu no
out_to_x yes
own_window yes
own_window_type override
own_window_transparent yes
own_window_class conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300 10
maximum_width 300
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color black
alignment bottom_right
gap_x 12
gap_y 30
no_buffers no
uppercase no
cpu_avg_samples 2
override_utf8_locale no

Enjoy!! (if you want to my conky scripts, just ask and I can post them)

DNS-321 Added to My Collection

As I said earlier this weekend, I recently obtained an NAS drive. I was having problems streaming HD movies over my wireless network, and was seeking another solution. After reading some reviews about this drive, I was shocked to find out how it operated. Most of the cons that swayed me to purchase it was;

one, it basically (as in fully) runs a small linux OS
two, it streams uPnP by default
three, it can be modified (hacked) to allow more options (ssh, web server, MediaTomb, package manager for more goodies, etc)
finally, which is obvious from the first reason, it doesn’t use NTFS or FAT for it’s partition, it uses EXT2 or EXT3.

Out of the box, I loaded it with all of my music and movies, and boom, it was sharing. I later found that it supported NFS so that I could mount it locally, and transfer even faster than ftp. All around, this was a GREAT purchase.

Not being satisfied, I ventured out a little, and started looking for modifications, after all, it isn’t perfect. I stumbled across fun_plug. This allows some great new features to be activated, and unlocks a lot of features that are locked otherwise. To sum it up, you interrupt the boot process, and obtain access to the core. This allows you to start ssh and unlock other features on the drive. This can be down with a few steps, download and copy the files over, reboot, and punch in a couple of commands.

A walkthrough will be under-way soon!

Creating a 32 Bit Chroot with Funtoo Sources (For Wine)

Since I can’t seem to get wine to work properly on the 64 bit build, I decided to break down and stop fighting the system. Just create a damn 32bit chroot so that everything works fine. The following (modified from the official gentoo site) were the steps that I took, and everything seemed to build fine with no problems. I put this is script format so if anyone wants to save 15 minutes of time, then they can just cut/paste this into vim, chmod it, and execute it. If you decide to be lazy like me, make sure that you review what you are stuffing into your make.conf file. It might not be what you wanted.

#!/bin/bash
mkdir /mnt/gentoo32
wget http://distro.ibiblio.org/pub/linux/distributions/funtoo/funtoo/x86/stage3-x86-current.tar.bz2
tar -xvjpf stage3-x86-current.tar.bz2
cp -L /etc/resolv.conf /mnt/gentoo32/etc/resolv.conf
cp -L /etc/passwd /mnt/gentoo32/etc/passwd
rm /mnt/gentoo32/etc/make.conf
echo "CFLAGS=\"-O2 -march=native -msse2 -pipe -fomit-frame-pointer\"" >> /mnt/gentoo32/etc/make.conf
echo "CHOST=\"i686-pc-linux-gnu\"" >> /mnt/gentoo32/etc/make.conf
echo "CXXFLAGS=\"${CFLAGS}\"" >> /mnt/gentoo32/etc/make.conf
echo "MAKEOPTS=\"-j2\"" >> /mnt/gentoo32/etc/make.conf
mount -o bind /dev /mnt/gentoo32/dev
mount -o bind /dev/pts /mnt/gentoo32/dev/pts
mount -o bind /dev/shm /mnt/gentoo32/dev/shm
mount -o bind /proc /mnt/gentoo32/proc
mount -o bind /proc/bus/usb /mnt/gentoo32/proc/bus/usb
mount -o bind /sys /mnt/gentoo32/sys
mkdir -p /mnt/gentoo32/usr/portage/
mount -o bind /usr/portage /mnt/gentoo32/usr/portage/
mount -o bind /tmp /mnt/gentoo32/tmp
emerge --noreplace sys-apps/util-linux
echo
echo /##################################################\
echo
echo NOW RUN THE FOLLOWING:    
echo # linux32 chroot /mnt/gentoo32 /bin/bash  
echo # source /etc/profile 
echo # env-update  
echo # emerge -vauND world
echo
echo \##################################################/

Removing Empty Sub-folders

(From Old Database) I was messing around with my music collection and found that I had many empty directories and sub-directories and wanted to get rid of them so that it wasn’t false excitement on certain bands. After days of searching, and trying to find a solution (without actually having to manually delete 2000+ directories manually) I found that simple commands help.

#find /path/to/dir -type d -exec rmdir {} \;

Just wanted to paste this so I wouldn’t forget it.