Well, it was bound to happen: Google rejecting IMAPS connections because I had too many simultaneous connections. Too many accounts for the places I'm affiliated with. In Apple mail, turn off "Use IDLE command if server supports it", and life should be better:
Monday, May 19, 2014
Tuesday, May 13, 2014
Restart backintime
There's a directory "~/.local/share/backintime" where backintime keeps its information. Specifically, the worker.lock contains the PID of the process; "kill `cat ~/.local/share/backintime/worker.lock`" stop the currently-running process. The "worker.message" file contain the message displayed in the tray notifier or backintime-gnome, and the "takesnapshot_.log" contains lots of good debugging messages if needed.
Friday, May 9, 2014
OS X and tsocks
I wanted to play around with tsocks, but it had multiple issues with compiling and working under OS X. I downloaded 1.8 beta 5 (from 2002!) from http://tsocks.sourceforge.net/ Here are the patches that worked for me, collected from a number of places hiding on the web.
===================================================================
RCS file: RCS/Makefile.in,v
retrieving revision 1.1
diff -c -r1.1 Makefile.in
*** Makefile.in 2014/05/09 16:50:45 1.1
--- Makefile.in 2014/05/09 17:28:10
***************
*** 13,19 ****
SHELL = /bin/sh
MKINSTALLDIRS = ${SHELL} mkinstalldirs
! SHCC = ${CC} -fPIC
INSPECT = inspectsocks
SAVE = saveme
LIB_NAME = libtsocks
--- 13,19 ----
SHELL = /bin/sh
MKINSTALLDIRS = ${SHELL} mkinstalldirs
! SHCC = ${CC}
INSPECT = inspectsocks
SAVE = saveme
LIB_NAME = libtsocks
***************
*** 23,29 ****
SCRIPT = tsocks
SHLIB_MAJOR = 1
SHLIB_MINOR = 8
! SHLIB = ${LIB_NAME}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
--- 23,30 ----
SCRIPT = tsocks
SHLIB_MAJOR = 1
SHLIB_MINOR = 8
! SHLIB = ${LIB_NAME}.dynlib
! DYNLIB_FLAGS=-dynamiclib
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
***************
*** 47,57 ****
${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}
${SAVE}: ${SAVE}.c
! ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o
! ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
! ln -sf ${SHLIB} ${LIB_NAME}.so
%.so: %.c
${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@
--- 48,57 ----
${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}
${SAVE}: ${SAVE}.c
! ${SHCC} ${CFLAGS} ${INCLUDES} -o ${SAVE} ${SAVE}.c
${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o
! ${SHCC} ${CFLAGS} ${INCLUDES} -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
%.so: %.c
${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@
***************
*** 68,75 ****
installlib:
${MKINSTALLDIRS} "${DESTDIR}${libdir}"
${INSTALL} ${SHLIB} ${DESTDIR}${libdir}
- ln -sf ${SHLIB} ${DESTDIR}${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR}
- ln -sf ${LIB_NAME}.so.${SHLIB_MAJOR} ${DESTDIR}${libdir}/${LIB_NAME}.so
installman:
${MKINSTALLDIRS} "${DESTDIR}${mandir}/man1"
--- 68,73 ----
===================================================================
RCS file: RCS/configure,v
retrieving revision 1.1
diff -c -r1.1 configure
*** configure 2014/05/09 16:42:31 1.1
--- configure 2014/05/09 16:42:45
***************
*** 4287,4293 ****
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct poll prototype" >&5
$as_echo_n "checking for correct poll prototype... " >&6; }
PROTO=
! for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout'
do
if test "${PROTO}" = ""; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--- 4287,4293 ----
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct poll prototype" >&5
$as_echo_n "checking for correct poll prototype... " >&6; }
PROTO=
! for testproto in 'struct pollfd *ufds, nfds_t nfds, int timeout'
do
if test "${PROTO}" = ""; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
===================================================================
RCS file: RCS/tsocks.c,v
retrieving revision 1.1
diff -c -r1.1 tsocks.c
*** tsocks.c 2014/05/09 16:45:58 1.1
--- tsocks.c 2014/05/09 17:25:16
***************
*** 68,74 ****
static char *conffile = NULL;
/* Exported Function Prototypes */
- void _init(void);
int connect(CONNECT_SIGNATURE);
int select(SELECT_SIGNATURE);
int poll(POLL_SIGNATURE);
--- 68,73 ----
***************
*** 100,105 ****
--- 99,105 ----
static int read_socksv5_connect(struct connreq *conn);
static int read_socksv5_auth(struct connreq *conn);
+ __attribute__((constructor))
void _init(void) {
#ifdef USE_OLD_DLSYM
void *lib;
***************
*** 191,199 ****
struct sockaddr_in *connaddr;
struct sockaddr_in peer_address;
struct sockaddr_in server_address;
! int gotvalidserver = 0, rc, namelen = sizeof(peer_address);
int sock_type = -1;
! int sock_type_len = sizeof(sock_type);
unsigned int res = -1;
struct serverent *path;
struct connreq *newconn;
--- 191,200 ----
struct sockaddr_in *connaddr;
struct sockaddr_in peer_address;
struct sockaddr_in server_address;
! int gotvalidserver = 0, rc;
! socklen_t namelen = sizeof(peer_address);
int sock_type = -1;
! socklen_t sock_type_len = sizeof(sock_type);
unsigned int res = -1;
struct serverent *path;
struct connreq *newconn;
I also rewrote the actual tsocks shell script, fixing it up for OS X in the process.
#!/bin/sh
# Wrapper script for use of the tsocks(8) transparent socksification library
#
# There are three forms of usage for this script:
#
# /usr/bin/tsocks program [program arguments...]
#
# This form sets the users DYLD_INSERT_LIBRARIES environment variable so that tsocks(8)
# will be loaded to socksify the application then executes the specified
# program (with the provided arguments). The following simple example might
# be used to telnet to www.foo.org via a tsocks.conf(5) configured socks server:
#
# /usr/bin/tsocks telnet www.foo.org
#
# The second form allows for tsocks(8) to be switched on and off for a
# session (that is, it adds and removes tsocks from the DYLD_INSERT_LIBRARIES environment
# variable). This form must be _sourced_ into the user's existing session
# (and will only work with bourne shell users):
#
# . /usr/bin/tsocks on
# telnet www.foo.org
# . /usr/bin/tsocks off
#
# Or
#
# source /usr/bin/tsocks on
# telnet www.foo.org
# source /usr/bin/tsocks off
#
# The third form creates a new shell with DYLD_INSERT_LIBRARIES set and is achieved
# simply by running the script with no arguments
#
# /usr/bin/tsocks
#
# When finished the user can simply terminate the shell with 'exit'
#
# This script is originally from the debian tsocks package by
# Tamas Szerb <toma@rulez.org>
if [ $# = 0 ] ; then
echo "$0: insufficient arguments"
exit
fi
case "$1" in
on)
export DYLD_FORCE_FLAT_NAMESPACE=1
export DYLD_INSERT_LIBRARIES="/lib/libtsocks.dynlib"
;;
off)
unset DYLD_FORCE_FLAT_NAMESPACE
unset DYLD_INSERT_LIBRARIES
;;
show|sh)
echo "DYLD_INSERT_LIBRARIES=\"$DYLD_INSERT_LIBRARIES\""
;;
-h|-?)
echo "$0: Please see tsocks(1) or read comment at top of $0"
;;
*)
export DYLD_FORCE_FLAT_NAMESPACE=1
export DYLD_INSERT_LIBRARIES="/lib/libtsocks.dynlib"
if [ $# = 0 ]
then
${SHELL:-/bin/sh}
fi
if [ $# -gt 0 ]
then
exec "$@"
fi
;;
esac
#EOF
Hope this helps someone.
Tuesday, April 29, 2014
Debian on a Soekris Net5501
CentOS requires an i686 processor, so that's out.
Thankfully, Debian releases a distribution for older processors, thanks Debian!
Debian does require 80M of memory, so the Net4501 is out. Use a BSD distribution for those.
Add a USB to serial connector and USB to ethernet connector.
Plug USB to ethernet connector into Eth 0 on Soekris.
Bring up USB to ethernet connector with address 192.168.0.1 (mine sits at eh3).
Start a tfpt server on by making sure /System/Library/LaunchDaemons/tftp.plist looks like:
and then launching it with "sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist". You stop it with "sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist" and can check if it's running with "netstat -ln -f inet -p udp | grep '\.69'" You then need to get a "netboot.tar.gz" from a "/debian/dists/wheezy/main/installer-i386/current/images/netboot/" respository. "gunzip" and "tar xf" that file into "/private/tftpboot", changing all the permissions to all everyone to read and write (!) The directory should look like
You must change the pxelinux.cfg/default file
Now, set up the bootp server file in /etc/bootpd.plist to be
That magic "cHhlbGludXguMAA=" string tell the client what to boot from, one can generate it using
Now, you can start the bootp server via "sudo /usr/libexec/bootpd -D -d -i en3" in a differnet terminal window.
Next up, we need a http mirror. I tried the following, but it wouldn't get through the install without barfing, though I'm not sure why -- it's a simple forward of the local http port. I didn't spend the time to track this one down.
What I did do was create a mirror on my Mac. I started up a Debian VM in VirtualBox and use apt-mirror. One needs to specify the i386 distro in "/etc/apt/mirror.list"
I linked the apt-mirror directory to one that I set up in VirtualBox:
For some reason, not all the necessary files were brought over by apt-mirror, so I did the following on the Debian VirtualBox instance:
Having this in place, I fired off a python web server in a different terminal window as it's there and ready to go
Connect to the Soekris serial port via something along the lines of
You'll need to turn off the firewalling. I tried for a little while to do so via either pfctl and the application firewall (http://krypted.com/tag/socketfilterfw/) but no happiness, so I shut the whole thing down, after removing the box from the net. Lame.
Boot the Soekris, and start through the install procedure. When you get to choosing the mirror, select the very first possbility "enter information manually".
Then specify the interface you are using, "192.168.0.1" in my case.
Choose manual partitioning of the disk. Create a 64MB partition at the beginning for /boot and a 500MB partition at the end for swap. Use the remainder for /.
One final bit of trickiness comes at the end. When you see the last screen:
Choose "Go Back" then:
"Execute a shell", then:
and change MODULES=most to MODULES=dep
Then:
and uncomment GRUB_DISABLE_LINUX_UUID=true
Then
These last few steps from http://debian.takhis.net/soekris/soekris.html
Thankfully, Debian releases a distribution for older processors, thanks Debian!
Debian does require 80M of memory, so the Net4501 is out. Use a BSD distribution for those.
Add a USB to serial connector and USB to ethernet connector.
Plug USB to ethernet connector into Eth 0 on Soekris.
Bring up USB to ethernet connector with address 192.168.0.1 (mine sits at eh3).
Start a tfpt server on by making sure /System/Library/LaunchDaemons/tftp.plist looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>com.apple.tftpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/libexec/tftpd</string>
<string>-i</string>
<string>/private/tftpboot</string>
</array>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<true/>
</dict>
<key>InitGroups</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>tftp</string>
<key>SockType</key>
<string>dgram</string>
</dict>
</dict>
</dict>
</plist>
and then launching it with "sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist". You stop it with "sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist" and can check if it's running with "netstat -ln -f inet -p udp | grep '\.69'" You then need to get a "netboot.tar.gz" from a "/debian/dists/wheezy/main/installer-i386/current/images/netboot/" respository. "gunzip" and "tar xf" that file into "/private/tftpboot", changing all the permissions to all everyone to read and write (!) The directory should look like
$ ls -l /private/tftpboot/
total 64
drwxrwxrwx@ 4 beaty-admin wheel 136 Jan 29 09:47 debian-installer/
-rwxrwxrwx@ 1 beaty-admin wheel 26474 Jan 29 09:47 pxelinux.0*
drwxrwxrwx@ 4 beaty-admin wheel 136 Jan 29 15:13 pxelinux.cfg/
-rwxrwxrwx@ 1 beaty-admin wheel 64 Jan 29 09:47 version.info*
You must change the pxelinux.cfg/default file
$ more pxelinux.cfg/default
console 0
serial 0 19200 0
default install
label install
menu label ^Install
menu default
kernel debian-installer/i386/linux
append initrd=debian-installer/i386/initrd.gz -- console=ttyS0,19200n8
Now, set up the bootp server file in /etc/bootpd.plist to be
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>dhcp_enabled</key>
<string>en3</string>
<key>Subnets</key>
<array>
<dict>
<key>name</key>
<string>192.168.0</string>
<key>net_mask</key>
<string>255.255.255.0</string>
<key>net_address</key>
<string>192.168.0.0</string>
<key>net_range</key>
<array>
<string>192.168.0.2</string>
<string>192.168.0.254</string>
</array>
<key>allocate</key>
<true/>
<key>dhcp_router</key>
<string>192.168.0.1</string>
<key>dhcp_option_66</key>
<string>192.168.0.1</string>
<key>dhcp_option_67</key>
<data>cHhlbGludXguMAA=</data>
</dict>
</array>
</dict>
That magic "cHhlbGludXguMAA=" string tell the client what to boot from, one can generate it using
$ printf 'pxelinux.0\0' | openssl base64
cHhlbGludXguMAA=
Now, you can start the bootp server via "sudo /usr/libexec/bootpd -D -d -i en3" in a differnet terminal window.
Next up, we need a http mirror. I tried the following, but it wouldn't get through the install without barfing, though I'm not sure why -- it's a simple forward of the local http port. I didn't spend the time to track this one down.
$ sudo su
$ while true; do netcat -L ftp.us.debian.org:80 -s 192.168.0.1 -p 80; done
What I did do was create a mirror on my Mac. I started up a Debian VM in VirtualBox and use apt-mirror. One needs to specify the i386 distro in "/etc/apt/mirror.list"
deb-i386 http://ftp.us.debian.org/debian wheezy main contrib
deb-i386 http://ftp.us.debian.org/debian wheezy-updates main contrib
deb-i386 http://ftp.us.debian.org/debian wheezy main/debian-installer
I linked the apt-mirror directory to one that I set up in VirtualBox:
# ls -l /var/spool/apt-mirror
lrwxrwxrwx 1 root root 31 Jan 29 13:46 /var/spool/apt-mirror -> /media/sf_VirtualBox/apt-mirror
For some reason, not all the necessary files were brought over by apt-mirror, so I did the following on the Debian VirtualBox instance:
mkdir -p /media/sf_VirtualBox/apt-mirror/mirror/ftp.us.debian.org/debian/dists/w
heezy/main/i18n
cd /media/sf_VirtualBox/apt-mirror/mirror/ftp.us.debian.org/debian/dists/wheezy/main/i18n
wget http://ftp.us.debian.org/debian/dists/wheezy/main/i18n/Translation-en.bz2
mkdir -p /media/sf_VirtualBox/apt-mirror/mirror/ftp.us.debian.org/debian/dists/wheezy/main/source
cd /media/sf_VirtualBox/apt-mirror/mirror/ftp.us.debian.org/debian/dists/wheezy/main/source
wget http://ftp.us.debian.org/debian/dists/wheezy/main/source/Sources.bz2
Having this in place, I fired off a python web server in a different terminal window as it's there and ready to go
cd ~/Desktop/VirtualBox/apt-mirror/mirror/ftp.us.debian.org; sudo python -m SimpleHTTPServer 80
Connect to the Soekris serial port via something along the lines of
sudo cu -l /dev/tty.PL2303-00* -s 19200
You'll need to turn off the firewalling. I tried for a little while to do so via either pfctl and the application firewall (http://krypted.com/tag/socketfilterfw/) but no happiness, so I shut the whole thing down, after removing the box from the net. Lame.
Boot the Soekris, and start through the install procedure. When you get to choosing the mirror, select the very first possbility "enter information manually".
Choose manual partitioning of the disk. Create a 64MB partition at the beginning for /boot and a 500MB partition at the end for swap. Use the remainder for /.
One final bit of trickiness comes at the end. When you see the last screen:
Choose "Go Back
"Execute a shell", then:
$ mount --bind /proc /target/proc
$ mount --bind /sys /target/sys
$ chroot /target /bin/bash --login
$ vi /etc/initramfs-tools/initramfs.conf
and change MODULES=most to MODULES=dep
Then:
$ vi /etc/default/grub
and uncomment GRUB_DISABLE_LINUX_UUID=true
Then
$ update-initramfs -u
$ grub-install --recheck /dev/sda
$ dpkg-reconfigure grub-pc
$ exit
$ exit
These last few steps from http://debian.takhis.net/soekris/soekris.html
Sunday, March 23, 2014
Debian/Ubuntu no ip
sudo cp debian.noip2.sh /etc/init.d/noip2
sudo chmod 755 /etc/init.d/noip2
sudo update-rc.d noip2 defaults
sudo chmod 755 /etc/init.d/noip2
sudo update-rc.d noip2 defaults
Sunday, March 2, 2014
Career
http://www.linkedin.com/today/post/article/20131111000517-5670386-a-secret-to-successful-interviews
http://thoughtcatalog.com/brianna-wiest/2014/02/15-crucial-pieces-of-career-advice-you-probably-wont-learn-in-a-classroom/
http://www.linkedin.com/today/post/article/20140215200145-131079-the-myth-of-the-bell-curve
http://www.linkedin.com/today/post/article/20130819190438-36052017-cut-your-meeting-time-by-90
http://www.careerconservatory.com/technical-interviews-an-instrument-of-exclusion-and-discrimination/
http://thoughtcatalog.com/brianna-wiest/2014/02/15-crucial-pieces-of-career-advice-you-probably-wont-learn-in-a-classroom/
http://www.linkedin.com/today/post/article/20140215200145-131079-the-myth-of-the-bell-curve
http://www.linkedin.com/today/post/article/20130819190438-36052017-cut-your-meeting-time-by-90
http://www.careerconservatory.com/technical-interviews-an-instrument-of-exclusion-and-discrimination/
Language is a virus from outer space
Here are some interesting links about languages.
http://www.prdaily.com/Main/Articles/13732.aspx
http://www.prdaily.com/Main/Articles/13732.aspx
Subscribe to:
Posts (Atom)





