Upcoming Games – OpenLieroX

March 31, 2008 at 10:23 am (Gaming, Lightweight, Linux)

I like to try new games, I generally don’t write about them though. I often shuffle through free gamer and game tome on the weekends to see what budding developers are doing. Some of them are pretty cool but few are worth talking about as they are all usually early in development. I was pulled in my OpenLieroX though.

I wasn’t a Windows user for many years so I never heard of it. Liero is an real time, excessive carnaged, Worms-clone. Though I have tried Worms before (and really liked it) I didn’t know what to expect. So a good clone would be something I’d like to see in Linux. Clones in general are something that I’ve learned to avoid. Good games are alot more than ideas and usually only pretentious developers feel they replicate the time and detail of a commercial success.

I’ve been real fortunately lately with games. I’m still playing OpenTyrian which rocks, and Wesnoth is alot of fun so I really didn’t need anything else, but I got the bug, or should I say… worm.

To be technical, OpenLieroX is a clone of Liero Extreme the most popular of Liero clones. So OpenLieroX is a clone of the of a clone of a clone, ok, I got it… :) This sounded discouraging but OpenLieroX is actually a polished game with some nice features.

For Gentoo users there is an ebuild available and debian users will also find a package on the website.

The plot of Liero is simple: destruction. Moving the worm about and firing various weapons is all Liero is basically about, but it’s Fun! Gameplay is smooth, there’s lots and lots of weapons, sound effects are all good too. Also there are a good number of mods to keep it interesting. Network play looks like it be a kick in the pants, and the CPU AI is about average. Maybe the screenshots will show it best.

The menu:

Local Play:

On a 747:

Now they’re trapped, think I’ll nuke ‘em.

Upcoming Games - OpenLieroX

The developer has been working on this steady for quite a bit now and I like his efforts. Good too see good games come into Linux. OpenLieroX is an unexpected surprise and well worth the try.

Permalink Leave a Comment

Links Saturday

March 29, 2008 at 7:24 am (Gentoo, Linux)

Links SaturdayWell springs nearly here and most the snow is gone. A record year hear in Wisconsin, we got a lot of snow (100.4 inches). The last week it snowed several inches, I didn’t bother to shovel. Dam stuff can just melt. :)

General Linux

Big Uncle Dave gave a nice roundup of distros on the horizon. I like keep an eye on what distros are doing but Dave knows some good inside outs of them.

Gentoo

LIP (Linux Install Podcast) has produced three episodes of a Gentoo Linux install. I have yet to check them out but I am definitely going to this afternoon.

Tux Training gives a brief look at emerge in:

Permalink Leave a Comment

Should Gentoo Ditch the LiveCD?

March 28, 2008 at 2:15 pm (Gentoo, Linux)

Should Gentoo Ditch the LiveCD?Just a quick thought: Should Gentoo ditch the LiveCD? 2007 was a bad year for Gentoo releases only getting one out for the first time in it’s short history. Gentoo 2007.0 tried to be a eight armed monster and supported most known arches, a couple package CDs, a LiveDVD and the Minimal CD.

The LiveCD was plagued with problems from slow unworkable desktops to X server and video card failures as noted in the forums. Writing a LiveCD is a monstrous task involving hundreds and thousands of different components. I not pointing blame as the CD worked fine for a certain group of people but I think many would agree the Gentoo LiveCD 2007.0 wasn’t ready for mass use. Often users users were pointed to or resorted to using the Gentoo 2007.0 Minimal CD.

Gentoo installation 2008.0 beta releases have been postponed temporarily from their planned release dates as developers have personal matters that need to be addressed. My best to them I do appreciate their hard work.

This said, the concern just recently stated by some users [1] [2] who have new machines don’t have a valid Gentoo CD to use for installation. Sure, their are alternatives like Ben talked about but your average user will never run across these solutions, never mind the curious Linux user from Ubuntu who was thinking of trying something different for his new HP.

Whither LiveCD?

Permalink 9 Comments

Gentoo – Utilities tmpwatch and flagedit

March 27, 2008 at 9:17 am (Gentoo)

Gentoo - Utilities tmpwatch and flageditGentoo users eventually branch out from the utilites Portage gives to do more advanced tasks, quicker. There are a good number of these utilites in the Portage tree including tmpwatch and flagedit.

tmpwatch

tmpwatch is just as it sounds and wipes specified directories. Baselayout does have the bootmisc that can wipe /tmp.

File:/etc/conf.d/bootmisc

WIPE_TMP="yes"

To wipe other directories like portage’s temporary directory, tmpwatch can be used. Tmpwatch can wipe based on several different time criteria, most useful being -mtime and -atime. -mtime is the modification time and -atime is the access time. Most people have atime disabled in their /etc/fstab file which isn’t used much for desktop system. Access time writes are writes everytime a file is accessed a process that can really bottleneck I/O on busy systems. Tmpwatch is in portage:

emerge tmpwatch

Tmpwatch is a basic cronjob and will need to be edited.

sudo vim /etc/cron.daily/tmpwatch

The file is pretty well commented and provides examples to wipe /tmp, wipe package sources (distfiles), the portage tmp directory…

Like I said most people will probably want to change -atime to -mtime.

if [[ -d /tmp ]]; then
    ${TMPWATCH} --exclude-user username --mtime 24 /tmp
fi

Units are in hours measures.

flagedit

emerge flagedit

Flagedit hasn’t been developed for two years so “I hope you know what you’re doing” will be spit out everytime changing the USE flags. Yes, I know what I’m doing. That said add or subtracting USE flags works just fine.

Edit global USE flags:

flagedit +alsa
flagedit -alsa
flagedit %alsa

This adds, subtracts and prunes the alsa USE flag globally in Portage. Adding USE flags globally edits the /etc/make.conf while adding USE flags locally edits /etc/portage/package.use on a per package basis. To add flags locally:

flagedit www-servers/lighttpd php fastcgi

Permalink 2 Comments

Wesnoth Tick

March 26, 2008 at 11:56 am (Gaming, Linux)

Wesnoth TickWarning: Content below contains mini-blogging and ranting. Not for sensitive peeps.

I like a good challenge. Often, if I go through something correctly in the first try I consider it not worth my time. Lately I’ve been playing “The Northern Rebirth” an Expert difficulty Wesnoth campaign. Well I’ve spent the last two weeks playing the first two chapters on and off which are incredibly difficult. To get moves exactly right and to prepare a perfect strategy are actually what I like doing. The second chapter requires near perfection and took many attempts before I finally got it right. So in the third chapter I’m bent on another tough battle but on turn three the leader is within sight and I thrash him. Way too easy. The next chapter became a good laugh for me. The hero enters the cave where he finds an evil skeleton king. In the contentious conversation between them the persuasive evil king tries to lure the hero and get him to kill his allied dwarf friend. If I kill the dwarf he promises me power and strength. Sort of the “You don’t know the power of the dark side type of thing.” So I’m actually given a choice if I want to do so. How cool. Of course I’ll kill him, this sounds neat. Now I didn’t think he’d actually do it. So the story, the hero actually attacks the dwarf and becomes a dark minion. And… Game Over. R U Kidding! !@#$!@#$!#@$@ Whaa… (Pounds on Keyboard). How !@#$ was that! I thought I’d at least I’d get a chance to free the hero for the dark side. Fooooo.

Case in point. Don’t play Northern Rebirth, it sucks. Why are Wesnoth developers putting such an untested campaign into the stock game?

Permalink Leave a Comment

RIP!? UDSF

March 25, 2008 at 12:13 pm (Linux)

Just found out the http://doc.gwos.org/ (UDSF) has been taken down. What a shame. UDSF was run by a group of users and moderators at the Ubuntu Forums and one of the more useful resources on the net – I remember getting a lot of useful information off that. Sorry guys, it was very very good.

Permalink Leave a Comment

The Three Amigos – Tar, bz2, and gunzip

March 25, 2008 at 5:36 am (Linux)

Lucky Day: Wherever there is injustice, you will find us.
Ned Nederlander: Wherever there is suffering, we’ll be there.
Dusty Bottoms: Wherever liberty is threatened, you will find…
Lucky Day, Ned Nederlander, Dusty Bottoms: The Three Amigos!

Dusty Bottoms: Do you have anything here besides Mexican food?

Tar, bz2, and gunzipBeginning with Linux meant getting to know the obscure file.tar.gz I had sometimes seen trespassing in Windows. To begin with, this extra dot threw me off – what does that mean? And what about these extensions that weren’t always the same, similar but different – .tgz, tar.bz2, tb2. Well here is what tar is and his amigos gunzip and bunzip2.

Tar is a file format and a program. Tar is short for tape archive, whence once tape media was used to backup data. Tar is a program to create a file that is a container of other files. Tar follows the Unix Philosophy “do one thing and do it well” paradigm and is ONLY a container of files. Tar files are not compressed (though they are typically compressed afterword to save space which are typically termed tarballs). Most tar compressions are either done with the gzip or the bzip2 programs. Why not compress a bunch of files with just gzip or bzip2 then? Because gzip and bzip2 follow the Unix Philosophy as well and can only compress one file. The tar program only has the ability to concatenate files, gzip and bzip2 have the ability to compress single files.Tar, bz2, and gunzip

Tar though does have built-in ability to work in conjunction with gzip and bzip2 compression (bzip2 is becoming a more popular format because it provides provides higher compression).

To tar and compress with gzip:

tar -cvpzf filename.tar.gz fileorfolder

To tar and compress with bzip2:

tar -cvpjf filename.tar.bz2 fileorfolder
  • -c is for create, v verbose, p preserve permissions, z gunzip, j is bunzip2, f is write to file
  • these arguments cannot generally be switched, the order is important.
  • tar.gz is the typical Unix format. For MSDOS compatibility sometimes .tgz or .bz2 will be seen.
  • any number of files can be specified file1 file3…

To see the list of files in a tar container:

tar -tzf filename.tar.gz
tar -tjf filename.tar.bz2

And to decompress:

tar -xvf file.tar.tgz
tar -xvf file.tar.bz2

I have experience with the new simplified way (-xvf) not always working and had to use the expanded form for bunzip2’s:

tar xvjpf file.bz2

Because I’m not good at remembering arguments I created a basic script called trex:

#!/bin/bash
# trex - tar files and folders

NAME=$1
LOCATION="$*"

if [[ -z $LOCATION ]]; then
    echo "tarer <compressed-name>.tgz </location/to/start>"
    echo "  - use absolute location if planning restores."
    exit;
fi

tar -czpvf "$NAME".tgz "$LOCATION"

References

Permalink 7 Comments

RSS Viewers – Liferea and a Preview of Straw

March 24, 2008 at 11:24 am (Linux)

When I first read about people using RSS viewers, I thought, whats the point? Ah… one of those so many things with market to make our life easier but are they just glossy wrappers keeping us away from the candy? So after hearing tante touch about them last week, I decided to try Liferea with a bit of sketicism.

The point of RSS viewers is to collect blogs and news stories and put them in a central application to know when pages are updated and to minimize browser-hopping.

My necessities for a RSS viewer are:

  1. Light. I have computer from 1999 and my browser does fine for most details I need to look up. Could a RSS viewer do this better, faster?
  2. The ability to load pictures would be nice but… not a requirement.
  3. All the other things I would expect from a RSS viewer: regular updates, readable text (or the ability to change it), ability to change between posts and feeds quickly, and being able to launch the browser when required.

I looked at two Gnome RSS viewers actually (Liferea and Straw). Here’s a look at Liferea, and I’ll give a short preview of Straw too.

Liferea

Liferea is the champ of Gnome RSS viewers, in fact, its really the only one. Straw is still in early development and Blam is no longer being developed. There is RSSOwl which looks promising but a Java app on this computer I’d guarantee won’t be light.

Liferea was easy enough to install without too big of a download or too many dependencies.

Liferea stays permanently docked in the notification area a nice feature for us news hounds.

With Epiphany extension “News Feed Subscription”, subsribing is as simple as ‘click’:

Liferea uses a three pane view which I have mixed thoughts about. Well done is support for displaying image and basic formatting:

Built-in support for Firefox which allows Liferea to display webpages in it’s own tab:

RSS Viewers - Liferea and a Preview of Straw

Liferea does some things really well. It seperates subscriptions nicely, allowing each their own preference. I found the readability of text very good in Liferea – like a good amount of attention was put into it. This alone marks Liferea numero uno muy bibilios. It supports Atom, RSS and Feedburner feeds.

What paper cutted me about Liferea is it adds an extra 15 MB of memory to my memory load. Ouch. Not alot mind ya, but enough to make a difference on this computer. Also, Liferea does poorly on rendering html. Well, the rendering is ok, (uses Geckos layout engine) but the details, the fonts un-aliased with bad kerning… What is Liferea trying to do anyway, invent a new browser? Already Liferea has talked about adding Webkit support in the future. I don’t get it. Is Liferea seriously interested in the kind of development it takes to make Epiphany work?

Liferea should also consider an optional two pane approach. The three pain idea is nice for subscriptions where I only want to pick out one or two articles to look at, but for subscriptions where I like to view all the contents, it becomes a chore to have to manually flip between numerous posts.

Liferea is a good application and most of what I was looking for in a RSS viewer. Everything I needed was there… except for being light. It wasn’t extremely heavy, but it was not quicker than my using bookmarks in Epiphany. I’m guessing the built-in Firefox support is responsible for the bog down, it would be nice to be able to disable it.

Straw

Straws alot like Liferea… only younger.

Straw has an applet like Liferea that will tell the number of unread items. As of now, Straw does display some images and the text is formatted nicely. Straw has a nice feature when pressing the subscribe button that automatically adds the URL thats in the clipboard. All Atom, RSS2 and Feedburneer feeds worked without a hitch. There’s no support for post flipping yet via a button, so keyboard commands Shift N and P have to be used.

Straw performs pretty good. Its post flipping is really quick. It’s subscription loading, uh, not so quick.

Straw is probably a good six months a way from being able to be used for everyday use but I’m happy with what I saw and will be looking for it down the road.

Conclusion

For now, I’m going to stick with Epiphany. It’s fast, I do occasionally look at a page that hasn’t been updated but not very often. Liferea would be just what I need if it just responded a little bit better. Hmm, I suppose there’s always Google Reader, (Dirk shivers thinking fiscal domain). 

Permalink 6 Comments

Linux Tidbits

March 23, 2008 at 8:50 am (Linux)

Linux Tidbits

Linux Tidbits

Regular commands I use every day in Linux plus a few eclectic ones. Basically geared to the new user. Tips or thoughts, please let me know.

Man pages

In Linux there is a manual for just about anything. Learn about almost everything by “man command” in the terminal. (e.g. man ls). Or type “command –help” for a basic description. Also, many man pages also cover configuration files (man resolv.conf).

Basic Commands

  • Up key- Command History
  • Tab – Auto-completion, nice and handy for completing file-names, directory names, and commands.
  • Commands are in this form: command -arguments

Files ( + directories )

ls ( list ), -l ( long ), -a ( shows hidden )
cp ( copy )
mv ( move or rename ), mv filename1 filename2
rm ( remove ) Very dangerous to use as root. Use with caution. -r ( recursive ) -f ( force – needed to remove a link)

Wildcards to expand definitions:

  • * (matches any character), cp *.txt ~/Desktop
  • ? (matches any single character), cp file?.txt ~/Desktop
  • [characters] (Matches a range/set of characters), cp [a-n]*.txt ~/Desktop</li>
  • [!characters] (Matches any character that is not a member of the set characters)

Directories

cd    ( change directory )
pwd   ( print working directory )
mkdir ( mkdir )
  • A name followed by a / means it’s a directory, bash is pretty good about figuring out what you mean if don’t use it but some apps don’t. A safe syntax would be cd myfiles/

Command Output to Text (Standard Output)

ls /usr/bin > /home/user/Desktop/programs.txt

Add to an existing text file:

ls /sbin >> /home/user/Desktop/programs.txt

Pipes ( | )

  • Useful for using programs in conjunction with others
ls -l | less

Filters

Popular filters used after piping.

  • sort
  • uniq - removes duplicate lines of data
  • grep - returns the output of a specified pattern of characters
  • head, tail - outputs the first of last lines of output
  • tr - translates characters - can be used for upper/lower case conversion

Use grep to extract patterns from files

grep EE /etc/X11/xorg.conf

ls -all /dev | grep dvd

glxinfo | grep -i direct

Files and File Permissions

View file permissions

  • List the files in long view:
ls -l

-rwxr--r-- 1 user user 225444 2007-05-01 21:58 abc.pdf
| |  |  |      |    |
| |  |  world  |    group name
| |  group     owner name
| owner/user
directory?  

r = read = 4
w = write = 2
x = executable = 1

Change File Permissions

owner = 4+2+1 = 7 , group = 4 ...

The above file's permissions numerically is 744 to change permissions of the above file:

chmod 755 abc.pdf

Change Ownership

chown user:group /home/user/document.txt

Lazy way of make a file executable ;)

chmod +x /usr/bin/gmailto

File Systems

Show all partitions and their types (may not work on all types)

sudo fdisk -l

Show partition used/available space:

df -h

See all file systems mounted:

cat /proc/mounts

Sort Directories by How much space they consume

du | sort -nr

Mount a Volume and add it in permanently:

  • The fstab file tells system of available disks/partitions and can automatically mount it at boot.
sudo mkdir /mnt/USB-Drive
sudo mount /dev/sda2 -t vfat -o rw /mnt/USB-Drive
  • types include hfsplus, vfat...

Enter in /etc/fstab:

/dev/sda2    /mnt/OSX          hfsplus ro,exec,auto,users    0      0
/dev/sda4    /mnt/Shared_Disk  vfat users,auto,uid=1000,gid=100,umask=007  0 0
  • ro - read-only, rw - read-write, auto mounts filesystem on boot

Unmount all possible file systems:

umount -a

Check File Systems

  • Mounted file systems should be checked from the Installer CD/DVD or on boot.

Force file system check on next boot (won't do it immediately):

sudo touch /forcefsck

Reboot immediately and check for errors:

sudo shutdown -Fr now

Change how often fsck runs at boot:

sudo tune2fs -c 30 /dev/hda

Check and mark bad blocks on damaged drives:

mke2fs -j -c /dev/hda3

Get UUID of devices:
At times the fstab file will require a device ID (UUID) be supplied.

ls /dev/disk/by-uuid -alh

Swap

Create swapfile

dd if=/dev/zero of=/swapfile bs=1024 count=2097152
  • Swap is recommended to be 1-1/2 to 2x the value of the RAM to use for hibernation.
  • 1 GB = 1024 MB = 1024 x 1024 kB = 1048576 kB = 1048576 kB x 1024 bytes/kB = 1,073,741,800 bytes10
mkswap /swapfile
swapon /swapfile

Add to /etc/fstab:

/swapfile              swap             swap     defaults

Controlling Swap

Turn off swap:
swapoff -a /swap

  • Swapiness is the input/output priority of swap. To measure the current value:
cat /proc/sys/vm/swappiness

To change the swap priority (higher value means more swapping):

sysctl vm.swappiness=10
  • values of 20 or lower are better for laptops.

File Compression

Pack:

tar gunzip:
tar cvpzf /AreaToSaveTo/yourcompressedfile.tgz --exclude=/this/folderorfile /CompressionStarts/Here
tar.bz2(tbz2) (block sorted, better compression):
tar -cvjf files.tar.bz2 fileorfolder
bzcat linux-2.6.XX.tar.bz2 | tar x

Unpack:

tar gunzip:
tar -xf file.tgz
tar xvjpf file.bz2 /startplace
tar.bz2(.tbz2):
bzcat file.tbz2 | tar file.tar

View contents of tar files:

tar tzvf name_of_file.tar.gz | less

unrar

unrar e file.part01.rar
  • Now works in conjunction with file roller.

Span Multiple Volumes

create:

tar -c -M --tape-length=2294900 --file=part1.tar too-large-archive.tgz

extract:

tar -x -M --file=part1.tar too-large-archive.tgz
  • At prompt specify new (n),
  • then specify volume name (e.g. n part2.tar)
  • tape-length is 1024 bytes measurement
    • or (1 computer kilo)

Or use "split" to break a large volume:split -b 2m largefile LF_

  • 2m = 2 megabytes LF is the prefix for new name
tar -cvj /full/path/to/mybigfile | split -b 650m

Put back together:

cat file* > newfile

Backup and Restore

Tar - From Install CD

cd /mnt/gentoo
tar -czpvf /mnt/gentoo/MacBook-Gentoo-Backup.tgz *

Rsync - Full Backup

rsync -avtp --delete --exclude=/home/user/somedir /source/dir /destination/dir
  • -a archive, -v verbose
  • -t preserve modification times, -p permissions
  • --delete removes destination file if has been removed from source
  • --links recreate symlinks
  • -z compress from source to destination - good for slow connections.
  • use "-a e ssh source name@hostname:dest" for ssh

Rsync - Incremental Backup
NEEDED? I think the above does Incremental too.rsync -b --backup-dir= combination

  • used for daily or every other day

Users

Add user

useradd -m -G adm,audio,cdrom,cdrw,cron,games,plugdev,portage,shutdown,usb,users,video,wheel -s /bin/bash user
  • Groups may vary some per distribution, this one is for Gentoo.
  • Some groups may not be available until installation is finished

Add/delete user to group

gpasswd -a user plugdev
gpasswd -d user plugdev

See what groups user belongs to

id

Remove user

userdel username

CD / DVD

Writing to CD/DVD with Rock-Ridge support

  • Rock-ridge support add Unix file extensions and attributes for iso9660 standard disks.
  • DVD are marked as 4.7GB capacity but thats just the marketing measure. In terms the computer understand the space on a DVD is 4.368 GB's
  • 1 GB = 1048576 kB x 1024 bytes/kB
  • DVD +R at 4x or 8x for best performance

DVD

growisofs -Z /dev/dvd -lrJ -joliet-long /path/to/files
  • -Z means to start at the beginning of the dvd
  • -l allows long filenames (breaks DOS compatability)
  • -r Rock-ridge support
  • -J Add Joiliet support
  • -joliet-long - allows Joliet filenames to be 103 characters long instead of 64 - breaks joliet compatibility but works in most cases.

CD

mkisofs -o my.iso -lrJ /path/to/files
  • Then burn iso to CD.
  • Not sure if I can write directly to CD, from what I've seen it would seem that I can't.

Blanking a Disk

  • If you want to blank a disk or it already has a file-system on it you'll see an error like "WARNING: /dev/hda already carries isofs!" then reinitialize the filesystem:

DVD

dvd+rw-format -f /dev/dvd
growisofs -Z /dev/hda=/dev/zero

CD

cdrecord -v dev=/dev/hda blank=fast
cdrecord -v dev=/dev/hda speed=2 blank=fast
cdrecord -vv dev=1,0 blank=all

ISO

Write ISO to CD/Drive:

dd if=name.iso of=/dev/sdb1

Mount ISO:

mount -t iso9660 -o loop,ro name.iso /mnt/cdrom/
mount /path/to/name.iso /mnt/cdrom -t iso9660 -o ro,loop=/dev/loop0

Create an ISO from a DVD or CD:

dd if=/dev/hda of=name.iso

Create and ISO from a file/directory:

mkisofs -o name.iso /path/to/file_or_directory

CDRWin (.bin/.cue) images to .iso:

bchunk name.bin name.cue name.iso
bin2iso name.cue

Converting CloneCD images to ISO:

ccd2iso name.img name.iso

Converting nrg (Nero) images to ISO:

nrg2iso name.nrg name.iso

Support for writting large file sizes

  • ISO has file size limit of 4GB
  • untested - udf support is still in alpha
mkisofs -o my.iso -lrJ -allow-limited-size -udf file-or-pathtofiles
growisofo -Z /dev/dvd -lrJ -allow-limited-size -udf file-or-pathtofiles

Mouse/Keyboard

Change keymaps:

setxkbmap dvorak

Map pointer buttons to keyboard:

xmodmap -e 'keycode 116 = Pointer_Button2'
xmodmap -e 'keycode 108 = Pointer_Button3'
xkbset exp m

Hardware Info

Kernel messages about hardware

dmesg | less

Cpu info:

cat /proc/cpuinfo

List all PCI devices

lspci

Detect hardware as it's plugged in

tail -f /var/log/messages

For more detail

lshal --monitor

Icons / Cursors / Fonts ...

Reset Icon Cache

gtk-update-icon-cache -f /usr/share/icons/hicolor/

Convert Windows Icons to Linux

Reset cache for fonts:

fc-cache -vf

Build font info per directory:

mkfontscale
mkfontdir

Replace fonts script

cd /etc/fonts/conf.d/ && ln -sf ../conf.avail/61-replace-corefonts.

Take screenshot of selected area

import filename.png

Set gamma

  • If you have ability to calibrate your own icc profile ( Macintosh's do ) copy the icc profile to Linux and use "xcalib icc.profile", otherwise a basic gamma can be set:
xgamma -bgamma 0.925 -ggamma 0.925 -rgamma 0.925

System

Shutdown at a specific time

shutdown -h 22:33

Manually Shutdown

shutdown -P now

date
use "date" to check date and to set system clock:

date MonthDayHourMinuteYear

Find out kernel version:

uname -r

Start Program that isn't in the Systems Path

  • Only programs that are in a system's PATH setting can be started by typing the command
./program

Disable Touchpad whilest Typing

syndaemon -d -t -i 2

Networking

Samba

Change or add password to smbconf:

sudo smbpasswd -L -a user

Mount SMB share to folder

sudo smbmount //192.168.1.105/user/ mnt/directory -o username=username,password=pass,uid=1000,mask=000

Mount all Samba Shares in fstab

mount -a -t smbfs

SSH / SCP

Remote login with ssh with username (diiferent that the one you're using)

ssh -l username 192.168.1.101

Copy remote file to local file

scp -p user@192.168.1.101:~/Desktop/file.name file.name

Download entire website:

wget -r http://www.robot-frog.com/

Advanced

Bash

The ~/.bashrc file

  • Adding PATHs to the ~/.bashrc file will make the system aware of another folder that has executables.
  • Shortcuts can be created for common commands
export PATH=$PATH:/home/user/.scripts
alias capscreen="import ~/Desktop/screen.png"

Analyze Bash History

cat .bash_history | tr '|' '\n' | awk '{print $1}' | \
egrep -o '([^/]+)$' | sort | uniq -c | sort -nr | awk '{print $2 "," $1}'

To see the preset variables already defined for bash:

set

Search History

ctrl-r

Cron

  • Cron is the system timer. It checks every minute for commands to run.

To edit a crontab (cron jobs)

crontab -e

#   minute (0-59),
#   |   hour (0-23),
#   |   |   day of the month (1-31),
#   |   |   |   month of the year (1-12),
#   |   |   |   |   day of the week (0-6 with 0=Sunday).
#   |   |   |   |   |   user
#   |   |   |   |   |   |   commands
43  08  *   *   *       env DISPLAY=:0.0 audacious [[/home/user]] /My\ Music/Other/Alarms/301gq.mp3

chroot - (changing root)

  • Userful for logging into your current Linux from an installtion CD
su
mkdir /mnt/osname
mount /dev/sda3 /mnt/osname
mount -t proc none /mnt/osname/proc
mount -o bind /dev /mnt/osname/dev
chroot /mnt/osname /bin/bash

Compile Kernel

make oldconfig
make menuconfig
make clean zImage modules modules_install install

For PPC "make pmac32_defconfig" will generate a basic config.

Find Modules

find /lib/modules/2.6.20-gentoo-r2-ibook-SE-g3 -type f -iname '*.o' -or -iname '*.ko'

Add the screen program to be able to background a terminal process
screen command

  • CTRL + A + D to background it, to return it:screen -r

Use noup to continue a process even if you log out
noup command

Unsorted / Less Used

sudo echo >> no work

echo "my text" | tee /etc/portage/package.use

See whats taking up ram:

ps auxf --sort size

Generate Modelines for xorg.conf

gtf screenwidth screenheight vertrefresh

Reset settings in gconf:

gconftool-2 --recursive-unset /apps/compiz 

GDM conf file

Touch Entire System
(careful I've done this before when my files got dated wrong from a dead battery. But I tried again and the files are put where the command is executed - all 0 bytes)

find /| xargs touch - m

Allow window executables to run directly (will need Wine and misc. binaries enabled in kernel)
In /etc/sysctl.conf add

fs.binfmt_misc.register = :WINEXE:M::MZ::/usr/bin/cedega:

and add to fstab

none  /proc/sys/fs/binfmt_misc  binfmt_misc  defaults 0 0

Re-size Images

  • requires imagemagick
convert writes new image, mogrify overwritesconvert image.jpg --resize 800x600 newresized.pngmogrify -geometry 1024x768 *.png

Copy ALL Files (+invisible, hard links, softlinks)

find . -depth -print0 | cpio –null –sparse -pvd /mnt/newhome/

Create random numbers, hex letters

dd if=/dev/random bs=1 count=5 2>/dev/null | xxd -ps

Run programs sequentially or concurrently

program && program
program & program

Hardware acceleration enabled?

glxinfo | grep rendering

A simple web server

Share files in directory and all subfolders:

python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"

View in:

http://localhost:8000 or http://your_ip:8000/

Debian Specific:

Run Program as normal user:

sudo dpkg-statoverride --update --add root root 4755 /usr/share/app

drive space show taken by installed packages

dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n

Rebuild Font Directory

dpkg-reconfigure fontconfig

 

Permalink 2 Comments

Links Saturday – Bens Bits and Local DNS

March 22, 2008 at 7:46 am (Gentoo, Linux)

Links SaturdayGood weekend everybody. Well, springs almost here and I’m beginning to get ready to go outside and enjoy nature, in the meantime I’ve decided to switch layouts for the blog. There were a couple formatting oddities with Ocean Mist so the Blix layout should be better for CSS formatting. Tell me what you think. I’m not sure I’m thrilled about the header though. Hmm… We’ll see.

Gentoo Links

This week Ben de Groot wrote some useful articles on Gentoo. (the site is down now, but should be back soon.)

  • First Ben points out the Gentoo’s LiveCD beta is still a work in progress but for those with compatibility problems with the 2007.0 LiveCD can try the Gentoo-based SystemRescueCD. The Rescue CD has a lot of tools and includes the 2.6.24 kernel.
  • New users should like How to be a successful Gentoo User which gives good tips to the basic Gentoo user. These type of writtings, I would like to see become officially a part of the Gentoo project.
  • In Know your distro: Gentoo documentation sources, a lot of good documented sources are listed. Gentoo users really do have one of the best documented Linux distributions around. To find reference to doing anything with Gentoo, someone has likely already tried it, is trying it, or has a good idea where to begin.

Other Linux

In a largely prophesying look, Federkiel looks into possible and developing parts of GTK+ 3.0.

Local

I’ve updated Local DNS for Faster Browsing to clear up a few ambiguous bits and reorganized it for better reading.

Have a good weekend everybody.

Permalink 3 Comments

Gentoo Linux Tidbits

March 21, 2008 at 11:53 am (Gentoo)

I’ve been using Gentoo for about two years now and I took notes on managing my system. These are those notes. I’ve since created a bash script that does many of the functions and I’ll just post it here because it is pretty self-explanatory. For more details read below.

If you’re interested in installing Gentoo take a look at Gentoo Quick Install.

#!/bin/sh
# /root/.bin/Gentoo/e - portage management tool

if [[ -z $@ ]]; then
  echo "e <option> <*option2/pkg> - portage management tasks:
  1 | oneshot   - adds a package as a dependency
  - | flagrem   - removes a global USE flag
  + | flagadd   - adds a global USE flag
  b | blocked   - blocked pkg workaround - <blocking> <tomerge>
  c | clean     - cleans (removes) package sources no longer in portage tree
  d | depclean  - remove unneeded dependencies
  e | elog      - view elog (developer notes for merged packages)
  f | flag      - add flag to package - <category/pkg flag>
  g | flaginfo  - information on a package's USE flags
  h | flaghas   - programs using USE flag
  i | install   - installs package (will use binary if available)
  k | keyword   - add keyword for unsupport archtechtures
  l | list      - lists files installed to a package
  o | owns      - check the file's owning package
  p | pretend   - check details of how a package is going to be added
  q | query     - search for an installed package
  r | remove    - remove package(s)
  s | search    - search for a package
  t | searchdes - search the description of packages
  u | upgrade   - emerge world (upgrade everything)
  x | check     - check installed pkg(s) integrity
  y | sync      - sync the portage database
  z | revdep    - rebuild dependencies
  freeze        - freeze a pkg update - <cat/pkg> <cat/pkg-version>
  unfreeze      - unfreeze a package - <package>
  unmask        - unmask package - <category/pkg-*version>
  gcl           - list installed gcc compilers
  gcs           - set new gcc compiler
  kl            - list available kernels
  ks            - select new kernel (will require bootloader update)"
  exit
fi

# change to ebuild directory, put in ~/.bashrc:
# cde () { cd "$(dirname `equery ewhich "$@"`)" ; }
# b | blocked   - untested
# unfreeze      - generic matching will delete any line that matches
# forcerm(add?) - removes package that can't otherwise be uninstalled
#    forcerm )           shift
#                        emerge --force "$@"
#                        ;;
# etc-update (add?)
# --resume --skipfirst (add?)

case $1 in
    1 | oneshot )       shift
                        emerge --oneshot "$@"
                        ;;
    - | flagrem )       shift
                        if [[ -z "$@" ]]; then
                          echo " exiting: flag required"
                          exit; else
                          euse -D "$@"
                        fi
                        ;;
    + | flagadd )       shift
                        if [[ -z "$@" ]]; then
                          echo " exiting: flag required"
                          exit; else
                          euse -E "$@"
                        fi
                        ;;
    B | Block )         shift
                        quickpkg $1
                        emerge --unmerge $1
                        emerge $2
                        emerge --usepkgonly --nodeps $1
                        ;;
    c | clean )         eclean distfiles
                        ;;
    d | depclean )      emerge --depclean
                        ;;
    e | elog )          less /var/log/portage/elog/summary.log
                        ;;
    f | flag )          shift
                        echo "$@" >> /etc/portage/package.use
                        ;;
    g | useinfo )       shift
                        equery uses "$@"
                        ;;
    h | flaghas )       shift
                        equery hasuse "$@"
                        ;;
    i | install )       shift
                        emerge --usepkg --ask "$@"
                        ;;
    k | keyword )       shift
                        echo -e "$@ **" >> /etc/portage/package.keywords
                        ;;
    l | ls | list )     shift
                        equery files "$@"
                        ;;
    o | own )           shift
                        equery belongs "$@"
                        ;;
    p | pretend )       shift
                        emerge -pv "$@"
                        ;;
    q | query )         shift
                        equery list "*$@*"
                        ;;
    r | remove )        shift
                        emerge --unmerge "$@"
                        ;;
    s | search )        shift
                        eix "$@"
                        ;;
    t | searchdes )     shift
                        eix -S "$@"
                        ;;
    u | upgrade )       emerge --update --newuse --deep --ask world
                        ;;
    x | check )         shift
                        equery check "$@"
                        ;;
    y | sync )          eix-sync
                        ;;
    z | revdep )        revdep-rebuild
                        ;;
    freeze )            shift
                        echo "$1" >> /etc/portage/package.mask
                        echo "$2" >> /etc/portage/package.unmask
                        ;;
    unfreeze )          shift
                        sed -i "/$@/d" /etc/portage/package.mask
                        sed -i "/$@/d" /etc/portage/package.unmask
                        ;;
    unmask )            shift
                        echo "$@" >> /etc/portage/package.unmask
                        ;;
    gcl )               gcc-config -l
                        ;;
    gcs )               shift
                        gcc-config "$@"
                        ;;
    kl )                eselect kernel list
                        ;;
    ks )                shift
                        eselect kernel set "$@"
                        ;;
    * )                 emerge "$@"
esac

About Portage

Gentoo Linux uses a package management system called Portage. Portage offers one of the most extensible and customizable package systems available in Linux.

System Update

Update all packages on the computer. This process involves: syncing Portage, creating a text file to review updates, updating the system, merging new configuration files, remove orphaned dependencies.

Sync the portage tree:

emerge –sync # or
eix-sync # preferrable for faster searches (eix search)

Examine update before install:

emerge -pv –update –newuse –deep world | less

If unexpected dependencies are being pull in, use the –tree variable to track it down.

Complete update:

emerge –update –newuse –deep world
etc-update
revdep-rebuild
glsa-check -f affected
eclean distfiles
  • In the first command, portage wiil update all packages on the system
  • etc-update is Portages configuration replacement tool. To merge configurations consider using dispatch-conf.
  • revdep-rebuild will check that all programs and libraries are linked correctly.
  • glsa-check is Gentoo’s security patches
  • eclean distfiles will remove package sources that aren’t installed anymore.

Remove Abandoned Dependencies:

emerge –depclean

Failed Package Emerge in a Compilation String

At times in a long list of package emerges like a system update, a package will fail to emerge. Bugzilla and the forums usually have information about known problems with the package, if not, it’s possible the package needs a newer version of a package that has not yet been installed in the compilation string. Skipping the problem package and emerging it again when the rest of the packages are compiled may fix the problem.

emerge –resume –skipfirst

Blocked Packages

Packages that block other packages from being emerged can be fixed by removing the obstructing packages and reinstalling it after blocked package is emerged.

quickpkg $BLOCKER
emerge -C $BLOCKER
emerge $BLOCKED
emerge –usepkgonly $BLOCKER

Specify USE Flags per package in /etc/portage/package.use:

pkg-category/pkg useflag useflag2

To add a USE flag temporarily (not recommended):

USE=”useflag” emerge package

Masked Packages (keyword)

The “missing keyword” mask states an ebuild doesn’t support or hasn’t been tested on the current architecture (x86, amd, ppc… ). Keywording can be added to /etc/portage/package.keywords:

media-libs/libquicktime ~ppc

Masked Packages (hard)

Gentoo hards masks some packages for security concerns, collisions… Packages are hard masked in /usr/portage/profiles/package.mask. If you like living on the edge, packages can be unmasked in /etc/portage/package.unmask.

Emerge dependency of a package

Packages that are dependencies of other packages (i.e. have no use on their own) should be emerged as “oneshot”. This is because if the main package is removed so too will this package when “emerge –depclean” is run. Otherwise these dependent packages are added to the world file.

emerge –oneshot package

Freeze a Package

If a rebuild of a package isn’t necessary or undesired, a package can be frozen. This is useful for kernels and other such packages.

Mask the generic package (i.e. without version) in /etc/portage/package.mask:

sys-kernel/gentoo-sources

Add the specific version to /etc/portage/package.unmask:

sys-kernel/gentoo-sources-version

Create a Binary Package

If enough disk space is available its may be a good idea to create binary of a package so it is quicker to re-install.

emerge –buildpkg zim

To install a binary package:

emerge –usepkg zim

Info About the Portage System

This information can be useful for reporting bugs:

emerge –info

Other Portage Tools

Info about USE flags (equery is part of gentoolkit):

equery uses package

Programs built with a specific USE flag:

equery hasuse useflag

View what files are installed by program:

equery files alsa-lib

View what packages install to a folder:

equery belongs /usr/share/fonts/misc

List all installed packages:

equery list

Select a new system profile (With each new revision (i.e. 2006.1 to 2007) new profiles are added. Profiles define basic system USE flags…):

eselect profile list
eselect profile set 4

then “Update System”.

Select new kernel:

eselect kernel list
eselect kernel set 2

Rebuild modules added from Portage. Some drivers build against the kernel (video drivers, sound drivers…).

module-rebuild

GCC Update. Update System for new GCC toolchain (yes both are recommended):

emerge -eav system
emerge -eav world

See installed GCC profiles and select one:

gcc-config -l
gcc-config 2

Then update the environment:

source /etc/profile

Create a binary of an already installed package:

quickpkg <package>

Clean portage world file:

Udept is a program that can speed up emerge by reducing the amount of calculations required by emerge. It does so by erasing repeat entries and dependencies in the world file (/var/lib/portage/world).

Note: Though udept can reduce emerge calculation time, it does so literally. For example, “epiphany-extensions” requires “epiphany” so udept sees “epiphany” as a dependency of “epiphany-extensions” and take it out of the world file. Later, if “epiphany-extensions” is unmerged, “emerge –depclean” will removed “epiphany”.

dep -w

Layman / Overlays

Overlays are package systems that run on top of Portage. Many Gentoo users eventually create their own overlay to be able to customize packages or build packages that are not yet in Gentoo Portage. A good number of third party overlays are available.

Local Overlay

Portage ebuilds can be edited to the users needs but once Portage has been synced all changes will be lost. Create a local overlay to edit ebuilds or make your own.

It’s best to see if the program has an ebuild in bugzilla or is in one of the third party overlays.

To make a personal overlay, create the overlay directory and let make.conf known of it (this folder can be almost anywhere).

mkdir /home/user/.portage-local

In make.conf:

PORTDIR_OVERLAY=”/home/user/.portage-local”

Ebuilds must be placed in a category that already exists in Portage.

mv package.ebuild ~/.portage-local/media-plugins/

Keyword if necessary:

emerge gentoolkit-dev
ekeyword ~ppc package-1.2.1.2.ebuild

Create a manifest and build:

ebuild ~/.portage-local/category/program/program-version.ebuild digest
emerge <package>

Layman

Layman is a manager for third party overlays (the most popular being sunrise).

emerge subversion
emerge layman

Add to make.conf:

source /usr/portage/local/layman/make.conf" >> /etc/make.conf
layman –fetch
layman –list # -Lk for a more complete list

To add an overlay:

Sunrise is the most popular overlay in portage. If it’s not in the regular portage tree check sunrise.

layman –add sunrise

Update layman overlays:

layman -S

Permalink 8 Comments

Next page »