HOWTO: Easily modify dependencies of a .deb file – Ubuntu Forums

By , 2010-06-28 10:35
#!/bin/bash
 
if [[ -z "$1" ]]; then
  echo "Syntax: $0 debfile"
  exit 1
fi
 
DEBFILE="$1"
TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modfied.deb
 
if [[ -e "$OUTPUT" ]]; then
  echo "$OUTPUT exists."
  rm -r "$TMPDIR"
  exit 1
fi
 
dpkg-deb -x "$DEBFILE" "$TMPDIR"
dpkg-deb --control "$DEBFILE" "$TMPDIR"/DEBIAN
 
if [[ ! -e "$TMPDIR"/DEBIAN/control ]]; then
  echo DEBIAN/control not found.
 
  rm -r "$TMPDIR"
  exit 1
fi
 
CONTROL="$TMPDIR"/DEBIAN/control
 
MOD=`stat -c "%y" "$CONTROL"`
vi "$CONTROL"
 
if [[ "$MOD" == `stat -c "%y" "$CONTROL"` ]]; then
  echo Not modfied.
else
  echo Building new deb...
  dpkg -b "$TMPDIR" "$OUTPUT"
fi
 
rm -r "$TMPDIR"

via HOWTO: Easily modify dependencies of a .deb file – Ubuntu Forums.

Ralink 3090 driver : Markus Heberling

By , 2010-06-25 22:33

ppa:markus-tisoft/rt3090

via Ralink 3090 driver : Markus Heberling.

Driver for the cheap Ralink wireless in the Acer Aspire Revo.

High Dynamic Range

By , 2010-06-25 21:10

Today I finally decided to try this HDR thing I’ve heard so much about. It was actually quite easy. I may not be getting optimal results, but I think what I got is pretty cool for messing around for 15 minutes. I just set up AEB on my Rebel XSi, then took the resultant 3 images and threw them into Photomatix. The leftmost picture is the HDR-process result, and the other 3 are the -3, 0 and +3.

Hey Apple, YOU’RE holding it wrong

By , 2010-06-25 09:47

So yesterday, the iPhone 4 was released in the US, the UK and many other countries other than Canada. And the Internet is all abuzz over the problems with reception on the iPhone 4. Basically, the problem is that human hands are conductive, and when holding the bottom left corner of the phone, skin creates a bridge between the HSPA and Bluetooth/Wifi antennae (antennas?) and causes the phone to drop connections as seen here:

[stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3D03PQyWp0mWE%26feature%3Dplayer_embedded img=x:/img.youtube.com/vi/03PQyWp0mWE/0.jpg embed=false share=false width=450 height=253 dock=true controlbar=over bandwidth=high autostart=false /]

An iPhone 4 user sent an e-mail to Mr. Jobs regarding the problem and received a curt reply:

via engadget

So, according to Steve, we all need to adjust the way we hold our phones. Not a huge deal I suppose, but as a clever user pointed out, I think we learned by example.

via engadget

Headless uTorrent Linux server in OpenVZ

By , 2010-06-13 21:10

Yes, I know, another Linux post. What can I say, this is what I do these days.

I’ve been running a Windows server in a kvm VM just to be able to run uTorrent. This was overkill, had a crazy amount of overhead, and was unstable (downloading to a share on my Samba server). Today I decided to attempt a more efficient solution: uTorrent in Wine. (Yes, there are other BitTorrent clients, and even… NATIVE Linux clients, but I’ve found none of them match the speed of uTorrent for my connection except for kTorrent. However, I don’t have an Android and/or iPhone app to remote control kTorrent.) Wine is a supported platform, according to the uTorrent website, however I wanted to run it on a headless OpenVZ container, and not on a standard desktop Linux distro. Should still be pretty simple, but knowing me, I might forget something next time I try and set this up, so I’ll document it here.

  1. Create a fresh VZ container. I used the Proxmox Debian 6.0 (squeeze) – standard i386 template.
  2. Edit /etc/apt/sources.list to point to a fast mirror in Canada (iweb!)
    deb http://debian.mirror.iweb.ca/debian squeeze main contrib non-free
    deb http://debian.mirror.iweb.ca/debian-security squeeze/updates main contrib non-free
  3. run an apt-get update && apt-get upgrade
  4. apt-get install wine sudo xterm openbox tightvncserver
  5. adduser matt
  6. add google repo: http://www.google.com/linuxrepositories/apt.html
  7. install Google Chrome
  8. wget http://download.utorrent.com/2.0.2/utorrent.exe
  9. From another PC: ssh -Y matt@openvz-container
  10. wine winecfg
  11. run vncserver and set a password.
  12. run wine utorrent.exe
  13. Enable Web UI

Next steps:

  1. Set up Dropbox for easy adding of torrents: http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall
  2. Make uTorrent and VNC server run on container startup*
  3. Create a VZ mount script so that torrents download outside of /vz area.

* For this I used a cool script obtained from http://www.abdevelopment.ca/blog/start-vnc-server-ubuntu-boot :

  1. Modify your ~/.vnc/xstartup to start the programs you want (gnome-session, lxde-session, utorrent, etc.)
  2. Save the following script as /etc/init.d/vncserver. Change
    export USER="mythtv"

    to the user you want to run the VNC session for.

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    networking
# Default-Start:     3 4 5
# Default-Stop:      0 6
### END INIT INFO
 
PATH="$PATH:/usr/X11R6/bin/"
 
# The Username:Group that will run VNC
export USER="mythtv"
#${RUNAS}
 
# The display that VNC will use
DISPLAY="1"
 
# Color depth (between 8 and 32)
DEPTH="16"
 
# The Desktop geometry to use.
#GEOMETRY="x"
#GEOMETRY="800x600"
GEOMETRY="1024x768"
#GEOMETRY="1280x1024"
 
# The name that the VNC Desktop will have.
NAME="my-vnc-server"
 
OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
 
. /lib/lsb/init-functions
 
case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
 
stop)
log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
 
restart)
$0 stop
$0 start
;;
esac
 
exit 0

For more info, see the source link.

Setting up Samba on Debian

By , 2010-06-05 10:30

Trying to set up Samba on a Debian server so that shares can be browsed as a guest, and user-authentication is optional. IIRC this is the default behaviour on Ubuntu.
After hours of messing around, I finally decided to grab the /etc/samba/smb.conf from and ubuntu machine and replace the debian one. And what do you know, it works.

seems the key directive is

usershare allow guests = yes

Ubuntu:

#======================= Global Settings =======================

[global]
 log file = /var/log/samba/log.%m
 passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
 obey pam restrictions = yes
 map to guest = bad user
 encrypt passwords = true
 passwd program = /usr/bin/passwd %u
 passdb backend = tdbsam
 dns proxy = no
 server string = %h server (Samba)
 unix password sync = yes
 unix extensions = no
 workgroup = WORKGROUP
 os level = 20
 syslog = 0
 panic action = /usr/share/samba/panic-action %d
 usershare allow guests = yes
 max log size = 1000
 pam password change = yes

Debian:

#======================= Global Settings =======================

[global]
 log file = /var/log/samba/log.%m
 passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
 obey pam restrictions = yes
 null passwords = yes
 encrypt passwords = yes
 public = yes
 passdb backend = tdbsam
 passwd program = /usr/bin/passwd %u
 unix extensions = no
 dns proxy = no
 server string = %h server
 unix password sync = yes
 workgroup = WORKGROUP
 os level = 20
 security = user
 syslog = 0
 panic action = /usr/share/samba/panic-action %d
 max log size = 1000
 pam password change = yes

Simple fix for Mac OS X 10.6.3 Samba Write Access problem – OS X Daily

By , 2010-06-02 21:53

Simple fix for Mac OS X 10.6.3 Samba Write Access problem – OS X Daily.

Why this hasn’t been fixed yet is beyond me.

Resetting Adium to use user account icon

By , 2010-06-01 21:47

A clean Adium profile wiill by default use your Mac’s user icon as the “display picture” for your IM accounts. Changing your DP once breaks this association.

To fix : Edit ~/Library/Application Support/Adium 2.0/Users/Default/Account Status.plist and delete the “User Icon” Data value.

That’s it!

Custom theme by me. Based on Panorama by Themocracy