RSS
 

Archive for the ‘Linux’ Category

Google Code Search Released

31 Aug

Finally, Google has released a code search that enables you to search through source code.

Similar to koders.com and others.

I haven’t seen too much of my own publical GPL code in here, but it’s a start.

The question is: Can I search for special characters?

VN:F [1.9.4_1102]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.4_1102]
Rating: 0 (from 0 votes)
Retweet
 
Comments Off

Posted in Development, Linux, Open Source

 

Uninstalling KDE or Gnome from Gentoo

24 Aug

Using ‘eix’ it becomes quite easy to construct a search command listing all the packages currently installed for a given category.

In my case, I wanted to unmerge (remove) all KDE and Gnome desktop packages from my Gentoo system, as I’ve been using it only as server for several years now.

# generate a list of gnome-base packages you have installed
eix -C gnome-base --only-names --installed

#send it to emerge once  you've got it
sudo emerge --ask -C `eix -C gnome-base --only-names --installed`

The ‘-C’ flag is the category base (ie: gnome-base or kde-base) — the other arguments should be obvious. You can always type ‘man eix’ for the specifics.

It’s a good idea to run ‘revdep-rebuild’ after removing packages as well.

sudo revdep-rebuild
VN:F [1.9.4_1102]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.4_1102]
Rating: +1 (from 1 vote)
Retweet
 
1 Comment

Posted in Linux

 

Logging IRSSI and Rotating them with Logrotate

19 Aug

I’ve often wanted to look back at chat logs. Below are a few simple steps you can take to enable logging in IRSSI and add the log files to the logrotate daemon.

Make irssi log all chat windows:

# Create the directory
$ sudo mkdir /var/log/irclogs
$ sudo chown username:users /var/log/irclogs

#in IRSSI window
/SET autolog ON
/SET autolog_path /var/log/irclogs/$tag/$0.log
/save #answer 'yes'

#verify chats are logged (grouped by hostname)
$ ls /var/log/irclogs
freenode

Tell logrotate to auto-rotate them:

$ sudo vi /etc/logrotate.d/irssi

#paste into editor
/var/log/irclogs/*/*.log {
  copytruncate
  compress
  notifempty
  missingok
}

Test that log rotation works for a channel (ie: #xml on freenode):

$ sudo /usr/sbin/logrotate -d /etc/logrotate.conf
$ sudo /usr/sbin/logrotate -f /etc/logrotate.conf
$ cd /var/log/irclogs
$ ls -R
./freenode:
#xml.log  #xml.log.1.gz
VN:F [1.9.4_1102]
Rating: 6.0/10 (3 votes cast)
VN:F [1.9.4_1102]
Rating: 0 (from 0 votes)
Retweet
 
Comments Off

Posted in Linux

 

Useful Debian Command Tip

10 Aug

I learned a few new commands that I haven’t used before:

To find a list of possible locations for a given application (in this case I choose “apt” which isn’t really a binary by itself, but rather a directory name used by “apt-get”.

$ whereis apt
apt: /etc/apt /usr/lib/apt /usr/share/apt /usr/share/man/man8/apt.8.gz

$ whereis apt-get
apt-get: /usr/bin/apt-get /usr/X11R6/bin/apt-get /usr/bin/X11/apt-get /usr/share/man/man8/apt-get.8.gz

Very cool for finding things quickly. If you didn’t catch what the output is, it is a simple space-delimited list of matches following the application name.

VN:F [1.9.4_1102]
Rating: 5.0/10 (1 vote cast)
VN:F [1.9.4_1102]
Rating: +1 (from 1 vote)
Retweet
 
Comments Off

Posted in Linux

 

Mounting a Samba Share and Amarok

03 Aug

I had some difficulties with streaming mp3 over fish:// protocol and the smb:// protocal from Ubuntu. I knew there was a way to mount the remote samba share locally on my Ubuntu filesystem.

First, you’ll have to download the necessary applications: smbfs and smbclient. For the purposes below, I have changed my remote host (the samba server) to “foo”.


root@localhost:~# apt-get install smbclient

Then you’ll have to create a “mount point” that will be on the local filesystem to access the remote filesystem. It is similar to mounting a dvd or cd-rom drive on ubuntu (typically under /mnt/dvd or /mnt/cdrom).


root@localhost:~# mkdir -p /x/foo

Now that we have a mount point and the smbclient software installed, try getting a listing of all available shares on the server named “foo”.


root@localhost:/x/foo# smbclient -L foo -U%
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.24]

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        HPDeskJet6122   Printer   HP DeskJet 6122 Network Printer
        share           Disk      Public Share
        IPC$            IPC       IPC Service (spring)
        HPOfficeJet4110 Printer   WinXP
        hpoffice-4110   Printer   HP OfficeJet 4110 hpijs
        hp_deskjet_6122_USB_1 Printer   hp deskjet 6122
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.24]

        Server               Comment
        ---------            -------
        FOO               foo

        Workgroup            Master
        ---------            -------
        WORKGROUP            FOO

The following command will actually mount the remote share dubbed “share” from remote server “foo” to the local path “/x/foo”. You should be prompted for your samba password on the host “foo”.


root@localhost:/x/foo# smbmount //foo/share /x/foo/ -o username=foouser,uid=1000,mask=000

You can now browse all the shared files on your local host by looking in /x/foo/.

VN:F [1.9.4_1102]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.4_1102]
Rating: +1 (from 1 vote)
Retweet
 
Comments Off

Posted in Linux

 

Enable Screensavers to Automically Start for KDE Desktop

27 Jul

Thanks to this tip, I was able to finally resolve my issue of KDE screensavers not automatically starting, or working with the hotkey enabled.

It makes perfect sense in hindsight.

The solution is to simply enable “Power saving features” from the Control Center in KDE.

To enable a “hotkey”, you can click “Advanced” for a particular screensaver (ie: Electric Sheep), and specify which corner you want to activate the screen saver.

Update: It appears that when using with a KVM switch that the resolution is not saved after KDE does a “power down” of the monitor. A bummer since I do not have a solution at this time.

VN:F [1.9.4_1102]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.4_1102]
Rating: 0 (from 0 votes)
Retweet
 
Comments Off

Posted in Linux

 

Installing ‘cpuid’ on Gentoo

20 Jul

Ever find yourself having to lookup up which CPU chipset you have installed on your PC? Forget?…too tired to take apart your PC?…or simply threw away the box? There’s a great little program called “cpuid” which divulges information about the guts of your CPU.

I find myself having to look up receipts on Newegg from time-to-time in order to ascertain which driver my hardware requires, especially with Linux-based operating systems, where a handy Windows Installation CD is useless.

With Gentoo Linux, there are many build flags that are available to you as well as Kernel config settings (w/all Linux distros) that can take advantage of your specific hardware.

Once installed, you’ll find a wealth of information as in this sample output of a few relavant lines from ‘cpuid’:


$ cpuid

CPU:
   vendor_id = "AuthenticAMD"
   version information (1/eax):
      processor type  = primary processor (0)
      family          = Intel Pentium 4/Pentium D/Pentium Extreme Edition/Celeron/Xeon/Xeon MP/Itanium2, AMD Athlon 64/Athlon XP-M/Opteron/Sempron/Turion (15)
      model           = 0xc (12)
      stepping id     = 0x0 (0)
      extended family = 0x0 (0)
      extended model  = 0x1 (1)
      (simple synth)  = AMD Athlon 64 (Winchester DH8-D0) / Sempron (Palermo DH8-D0) / mobile Athlon 64 (Oakville DH8-D0) / mobile Sempron (Palermo DH8-D0) / mobile Athlon XP-M (Winchester DH8-D0), 754-pin, 90nm
...
   extended processor signature (0x80000001/eax):
      generation     = AMD Athlon 64/Opteron/Sempron/Turion (15)
      model          = 0xc (12)
      stepping       = 0x0 (0)
      (simple synth) = AMD Athlon 64 (Winchester DH8-D0) / Sempron (Palermo DH8-D0) / mobile Athlon 64 (Oakville DH8-D0) / mobile Sempron (Palermo DH8-D0) / mobile Athlon XP-M (Winchester DH8-D0), 754-pin, 90nm
   extended feature flags (0x80000001/edx):
...
   brand = "AMD Sempron(tm) Processor 3000+"
...
  (multi-processing synth): none
  (synth) = AMD Sempron (Palermo DH8-D0), 754-pin, 90nm Processor 3000+

As of this writing, ‘cpuid’ has yet to become an official ebuild, but you can download the test ebuild script and follow the Gentoo-specific instructions instructions for using local portage ebuilds that have are still in the testing phase.

Here are the simpler installation procedures via apt-get for Debian-based systems:


$ apt-get install cpuid

Coming soon: Instructions for installing 3rd party ebuild scripts on Gentoo.

VN:F [1.9.4_1102]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.4_1102]
Rating: 0 (from 0 votes)
Retweet
 
Comments Off

Posted in Linux