sudo -u

•November 18, 2009 • Leave a Comment

sudo does not only let you run commands as root; using the -u <username> option you can run a command as any other user!

palimpsest

•November 17, 2009 • Leave a Comment

Normally, palimpsest is “a manuscript page from a scroll or book that has been scraped off and used again”. In the context of the gnome-disk-utility package, it’s a tool that lets you format/partition/mount/unmount/query s.m.a.r.t. attributes from disk drives and partitions.

Recently I’ve started getting a warning from this tool on my eee701 that the “disk is being used outside design parameters”. Looking up the details, it told me that attributes 32, 48, 56, 73 and 84 (none of which has a description!!!) are failing or have failed in the past. WTF?

Related thread: http://georgia.ubuntuforums.org/showthread.php?t=1307878

Related bug: https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/454301

wake-on-lan

•November 16, 2009 • Leave a Comment

To Wake-on-LAN a machine in your local subnet:

  1. enable the feature in the BIOS (on my AMIBIOS 0602 it was “Wake on PCI-E device”)
  2. find out the machine’s MAC address (I got it from my router, but ifconfig should do the job, too)
  3. install the wakeonlan package
  4. run wakeonlan <mac_address>

Gnome-Do

•November 11, 2009 • Leave a Comment

Discovered Gnome-Do recently. With it I can:

  • launch applications (like Alt+F2, but better)
  • find files & folders (by name)
  • act on your pidgin contacts
  • lookup google contacts
  • lookup/create google calendar events
  • search google maps
  • do a google search

There’s many more plugins to use.

Notes:

  • It has some stability/hanging issues in karmic
  • The Thunderbird plugin (community-supported) is abandoned and does not work

concatenate in openoffice calc

•November 6, 2009 • Leave a Comment

If you want a cell in OpenOffice Calc to contain multiple types of text (e.g. a fixed string and the result of a function), use the CONCATENATE function. For example, if the sum of column D is 19, then a cell containing =CONCATENATE(“YES=”, SUM(D2:D40)) will display YES=19.

tcprobe

•November 2, 2009 • Leave a Comment

To get info about a video file on the command line, install transcode and then run tcprobe -i <video_file>

Example output:

[tcprobe] RIFF data, AVI video
[tcprobe] summary for <filename_here>, (*) = not default, 0 = not detected
import frame size: -g 656x346 [720x576] (*)
 frame rate: -f 23.976 [25.000] frc=1 (*)
 audio track: -a 0 [0] -e 48000,0,2 [48000,16,2] -n 0x55 [0x2000] (*)
 bitrate=112 kbps
 length: 146626 frames, frame_time=41 msec, duration=1:41:55.532

printer sharing in Linux

•November 1, 2009 • Leave a Comment

To make an Ubuntu computer act as a printer server, follow these instructions.

The device URI on the server will look like this:

hp:/usb/<printer_name>?serial=<serial_number>

while on the client it’s:

ipp://<server_ip_address>:631/printers/<printer_name>

D-Link SharePort not for Linux

•November 1, 2009 • Leave a Comment

Got a D-Link DIR-655 router; it has a USB port on the back, that can be used in 3 modes:

  • Network USB: D-Link SharePort technology to share a hard disk or printer on your network
  • 3G USB Adapter: share your 3G connectivity on your local network
  • WCN Configuration: Windows Connect Now technology to transfer network settings on a USB flash disk

D-Link provides a Windows-only utility to use SharePort, while the actual manufacturer (Silex) also provides a MacOS utility. However (as usual) nothing for Linux…

reverse mapping failed

•November 1, 2009 • Leave a Comment

When you ssh into a machine from the same subnet, it tries to reverse-lookup you IP address. When that failes, sshd writes a message in your /var/log/auth.log saying:

reverse mapping checking getaddrinfo for rfc-1918 [ip_address_here] failed – POSSIBLE BREAK-IN ATTEMPT!

To stop getting that, add the names of your subnet machines in /etc/hosts

Exploring iPhoneOS

•October 30, 2009 • 2 Comments

Preparation:

  1. Jailbreak (blackra1n for 3.1.2)
  2. Install openssh, sudo, top
  3. Plug in (charging) to keep WiFi from going to sleep
  4. Ssh into it (username: mobile, default password: alpine)
  5. Change the default password immediately!!!

Some notes so far:

  • Your home directory: /var/mobile
  • Shell type: bash (configuration: /etc/profile)
  • Add yourself to /etc/sudoers
  • Change your prompt:
export PS1='\e[32;1m\u@\h\e[00m:\e[34;1m\w\e[00m$ '
  • Advanced ls output:

alias ls='ls -FhlX --color=auto'
  • More doesn’t seem to work (/bin/more: fork: retry: Resource temporarily unavailable)
  • Some more customizations in /etc/profile.d: coreutils.sh and terminal.sh
  • Run updatedb