Archive

Archive for the ‘Uncategorized’ Category

Flush DNS Cache in OSX

November 2nd, 2012 No comments

I can never figure out why Apple has to be different, and especially why the change (break) stuff that already works fine. Today’s example: flushing the DNS cache.

From terminal, these are the commands to flush the cache on several (relatively) recent versions of OSX:

Tiger
lookupd -flushcache

Leopard / Snow Leopard
dscacheutil -flushcache

Lion / Mountain Lion
sudo killall -HUP mDNSResponder

Categories: Uncategorized Tags:

Mountain Lion Timemachine Problems

October 15th, 2012 No comments

From the Apple discussion groups, drm31078 says:

Received another reply from synology pointing to Lion as the problem…

Here is what I received from my engineers.

This problem seems to have happened since OSX 10.7.
We use the open source – netatalk to support AFP and
it summarized that this problem also exists on Apple Time Capsule too.
(https://www.netafp.com/tn005-10-7-lion-time-machine-and-netatalkafp-620/
https://discussions.apple.com/message/17441528#17441528 )

For the Macs that doesn’t trigger “Start New Backup” YET,
users may use the following method to try and fix the verification flag and avoid wiping out all old backup history.
https://www.garth.org/archives/2011,08,27,169,fix-time-machine-sparsebundle-nas-b ased-backup-errors.html
https://pondini.org/TM/C13.html

Hey Apple are you seeing this?!?!

Netatalk 3.1 installation on Debian 6.0

August 27th, 2012 2 comments

I use a Debian 6.0 box running Netatalk to backup my Mac using Timemachine. This all worked nicely until recently upgrading to Mountain Lion when, big surprise, Timemachine/Netatalk became unreliable. This seems to happen pretty much every time Apple bumps OSX – for reasons know only to them, all sorts of breaking changes are required to change from one feline to another, while providing minimal value to users.

Some research later, it became clear that Mountain Lion needs Netatalk 3.1 (post 12/8/22) to run reliably.

The instructions here worked well: https://gist.github.com/2856490

Note: do not forget the “./bootstrap”. Also, missing from the requirements are autotools (automake) and libtool.

Quoted from github:

Install prerequisites:

    $ sudo apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev

Download src:

    $ cd /usr/local/src
    $ git clone git://netatalk.git.sourceforge.net/gitroot/netatalk/netatalk
    $ cd netatalk
    $ ./bootstrap

Find current version of Berkeley DB available

    $ apt-cache search libdb

Mine was 5.1, so I'll install that

    $ sudo apt-get install libdb5.1-dev db-util db5.1-util

Same for libgcrypt:

    $ apt-cache search libgcrypt
    $ sudo apt-get install libgcrypt11 libgcrypt11-dev

Configure install

    $ ./configure --with-init-style=debian --with-zeroconf

Build!

    $ make
    $ sudo checkinstall

Config is in /usr/local/etc/afp.conf
Categories: Uncategorized Tags:

Welcome back!

June 12th, 2012 No comments

Due to a faulty backup, recent (2012) posts are missing but will be restored as soon as I have a moment.

Categories: Uncategorized Tags:

Subtitles on XBMC

October 29th, 2011 No comments

Since minidlna doesn’t serve external subtitle files properly, merge the .srt and .avi files into an mkv file as follows:

mkvmerge -v -o movie.mkv movie.avi --sub-charset 0:UTF8 -s 0 -D -A movie.srt

A more general purpose script:

#!/bin/bash
INPUT=$(basename $1 .avi)
SRT=$(ls | grep $INPUT.srt)
SUB=$(ls | grep $INPUT.sub)
SSA=$(ls | grep $INPUT.ssa)
if [ "$SRT" != "" ]; then
#    mkvmerge -v -o $INPUT.mkv $1 $INPUT.srt
    mkvmerge -v -o $INPUT.mkv $1 --sub-charset 0:UTF8 -s 0 -D -A $INPUT.srt
#    mkvmerge -v -o $INPUT.mkv $1 $INPUT.eng.srt --sub-charset 0:UTF8 -s 0 -D -A $INPUT.spa.srt
elif [ "$SUB" != "" ]; then
    mkvmerge -v -o $INPUT.mkv $1 $INPUT.sub
elif [ "$SSA" != "" ]; then
    mkvmerge -v -o $INPUT.mkv $1 $INPUT.ssa
else
    mkvmerge -v -o $INPUT.mkv $1
fi

Unfortunately, this still doesn’t help for PS3, which doesn’t yet understand mkv.

Categories: Uncategorized Tags:

OCaml .ocamlinit

June 2nd, 2011 No comments

??Here handy trick I didn’t know about launching OCaml:

$ cat >> .ocamlinit
#use "topfind";;
#require "sdl";;
#require "sdlvideo";;

open Sdl
open Sdlvideo;;
open Str;;

.ocamlinit is sourced from the current directory, falling back to /home/user/.ocamlinit. you can explicitly override it via ocaml -init <filename>

 

Categories: Uncategorized Tags:

Google’s 8 Habits for Effective Managers

March 13th, 2011 No comments

Google did a data mining exercise to uncover what makes a good Google manager. and the 8 habits are:
Be a good coach
Empower your team, don’t micromanage
Express interest in team members’ success and personal wellbeing
Don’t be a sissy: Be productive and results-oriented
Be a good communicator and listen to your team
Help your employees with career development
Have a clear vision and strategy for the team
Have key technical skills so you can help the team
3 pitfalls:
Have trouble making a transition to the team
Lack a consistent approach to performance management and career development
Spend too little time managing and communicating

SystemRescueCd

December 31st, 2010 No comments

The SystemRescueCd has all sorts of useful tools to restore ailing Linux systems.
Check it out at: https://www.sysresccd.org

Grub Recovery on CentOS 5 with RAID

December 30th, 2010 No comments

I recently replaced the RAID 1 drives in my CentOS 5 box and had to reinstall the grub MBR. As the drives are a couple of TB each, I thought I’d try GPT instead of the old MBR partitioning, since soon all drives will exceed MBR’s 2TB limit. Luckily GPT is baked into RH/CentOS kernels (unlike many others).
Restoring the MBR was trickier than I expected and I made a couple of mistakes along the way – wish I had found the following description sooner:
https://idolinux.blogspot.com/2009/07/reinstall-grub-bootloader-on-md0.html

In a nutshell run grub interactively and do the following:

# grub
grub> root (hd0,0)        
root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd0)
setup (hd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
# reboot

OCaml for Mac

December 1st, 2010 1 comment

As I install most Linux/BSD software on Mac via Macports, I figured I’d forgo GODI and try to install OCaml the Macports way.

Everything went mostly smoothly except for ocamlnet which is installed as a dependency of batteries. By default, to avoid installing GPL software, Macports doesn’t build nethttpd and related modules. To work around this, perform the install as usual:

sudo port install caml-batteries

but this won’t install the httpd files. To the ocamlnet Portfile I had to add:

configure.args-append   -with-nethttpd

after configure.pre_args. Also, for ocamlnet 2.2.9, I had to patch src/batCamomile.ml as follows:

replace:
-module CDC = CamomileLibrary.CamomileDefaultConfig
with:
+module CDC = CamomileLibraryDefault.Config
and:
-include CamomileLibrary.Main.Make(CamConfig)
with:
+include CamomileLibrary.Make(CamConfig)
then port uninstall batteries (and ocamlnet), then reinstall.
Categories: Uncategorized Tags: