On my laptop I wanted to mount some directories (via samba) from my workstation so I could always access them. That part wasn’t too hard. Be sure to install smbfs (Samba file system utilities) and put the following line in your /etc/fstab:
/home/mtersmitten/.cred will contain your samba credentials like this:
username=####
password=####
So the samba path is //zeus/mtersmitten/Muziek and /media/samba/zeus/muziek is the local directory (on the laptop) where we want to mount it to. cifs is the filetype and ro means read-only.
Now comes the annoying part! When rebooting the laptop it would take forever to disconnect the mount(s) and I would get this kinds of errors:
CIFS VFS: Server not responding
CIFS VFS: no response for cmd 50 mid 30
Probably because the wireless connection already was terminated and the smb mount not… Fortunately, thanks to whereofwecannotspeak, I found a solution 🙂
“To unmount Samba shares before shutting down network services, run the following commands as root”
I wanted to have syntax highlighting for a big SQL file I was working on. Finding a solution didn’t take my too long. Source-highlight given a source file, produces a document with syntax highlighting. Output formats that are supported:
HTML
XHTML
LATEX
TEXINFO
ANSI
DocBook
Input formats that are supported:
Ada
Asm
Applescript
Awk
Autoconf files
Bat
Bib
Bison
C/C++
C#
CakePhp templates
Clipper
Cobol
Configuration files (generic)
Caml
Changelog
Css
D
Diff
Erlang
errors (compiler output)
Flex
Fortran
GLSL
Haskell
Haskell literate programming
Haxe
Html
ini files
Java
Javascript
KDE desktop files
Latex
Ldap files
Lisp
Logtalk
Log files
lsm files (Linux Software Map)
Lua
Makefile
Manifest
M4
ML
Oz
Pascal
Perl
pkg-config files
PHP
Postscript
Prolog
Properties files
Protobuf (Google’s Protocol Buffers)
Python
RPM Spec files
Ruby
Scala
Shell
S-Lang
Sql
Tcl
Texinfo
Vala
VBscript
XML
XOrg conf files
Exactly what I needed!
For Debian/Ubuntu get source-highlight to work is just as simple as:
apt-get install source-highlight
And adding these two environment variables (to .bashrc):
For some stuff that couldn’t bare the daylight I needed some anonymity. Tor (The Union Router) is really suited for this purpose:
“Tor is free software and an open network that helps you defend against a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security known as traffic analysis.
Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location. Tor works with many of your existing applications, including web browsers, instant messaging clients, remote login, and other applications based on the TCP protocol.”
A problem all web designers know is making a website work in Internet Explorer 6. IE 6 is not standards conforming. So even when you, as a designer, stick to the W3C rules there’s quite a chance your website won’t render as it should. A few big websites (i.e. Youtube, Apple’s MobileMe) already banned IE6 and even Javascript guru Douglas Crockford has called for a global IE6 boycott. Although the market share is rapidly declining, quite a large portion still seems to be using it; especially in Asia and Africa (+/- 21%).
IE6 Percentage
Why? IE6 was released in 2001, and even failed to properly support the CSS 1.0 standard from 1996…
IE6 Why?
We have to stop this oldie hold us back and make the Internet a better place 🙂
Free the web suggests:
make sure your browser is up to date
help others to get up to date
if you are a web designer, stop supporting IE6
spread the word: Boycott IE6
Ajaxian follows a more aggressive approach: amelie()
I would suggest we all just copy and paste the following code onto your site:
A few minutes ago I tried to add some music to my N900 for my girlfriend. Unfortunately the media player doesn’t automatically scan for new media (or it takes a while?). If you want to force the N900 to re-index everything just invoke this command in your X Terminal (or via SSH):
tracker-processes -r
Found 136 pids...
Setting database locations
Checking database directories exist
Checking database version
Checking database files exist
Removing all database files
Removing database:'/home/user/.local/share/tracker/data/common.db'
Removing database:'/var/tmp/tracker-user/cache.db'
Removing database:'/home/user/.cache/tracker/file-meta.db'
Removing database:'/home/user/.cache/tracker/file-contents.db'
Removing database:'/home/user/.cache/tracker/email-meta.db'
Removing database:'/home/user/.cache/tracker/email-contents.db'
Setting index database locations
Checking index directories exist
Checking index files exist
Removing all database index files
Removing database index:'/home/user/.cache/tracker/file-index.db'
Removing database index:'/home/user/.cache/tracker/email-index.db'
And after a few minutes (the player will show your) your music/video collection will be up to date!
Of course there are a million ways to do so (Samba, AFS, NFS, SSH, FTP et cetera), but I think this is the easiest way you’ve ever seen. It is called SimpleHTTPServer and the only requirement is that you have Python installed, which is the case for most Linux systems. You use it like this:
python -m SimpleHTTPServer
This will launce a simple webserver serving you currect directory via port 8000. It is obvious that this page will only be accessible when this port isn’t firewalled. When you acces this page it will show you something like this:
Browser Listing
And what you see on the console is:
Python Server SimpleHTTPServer
To have this command always with you, simply create an alias in your .bashrc:
alias pyServ='python -m SimpleHTTPServer'
As said before, by default the server listens on port 8000. If we would like it to listen on 8001 that’s also possibe. Just add another parameter:
python -m SimpleHTTPServer 8001
Two other, related, (Python written) file sharing utilities I came across a while ago are Droopy and Woof. Have a look at them the’re quite handy too!
DynDNS offers “free Dynamic DNS service that lets you easily connect to your home network from anywhere. Use your personalized URL to view home security cameras, download shared files from your VPN, or even host a personal website. Don’t pay for a static IP address; our software syncs your domain to your network automatically”
Of course it is (completely) pointless, but what the hack. You could use it for running public services (apache, ssh et cetera) on your N900 if your 3G provider assigns you a public IP address, but I guess the main purpose would be tracking your phone when it’s lost or stolen.
Since Python is already present on the N900 the easiest way to get things working would be a Python based DynDNS client. Such a client is available at sourceforge.net and is named ipcheck. So what we do is:
And I assume that you already have SSH (root) access to your phone
Download ipcheck to the N900
mkdir /opt/ipcheck -p
cd /opt/ipcheck
wget http://downloads.sourceforge.net/project/ipcheck/ipcheck.py?use_mirror=ovh
chmod 0755 ipcheck.py
A few days ago I was visiting one of my favorite sites (commandlinefu) and read something about “Color Highlighted Log Viewing” so I tried it and was instantly hooked. According to it’s website: “CCZE is a robust and modular log colorizer with plugins for apm, exim, fetchmail, httpd, postfix, procmail, squid, syslog, ulogd, vsftpd, xferlog, and more”
To get full control over your N900 what would by easier than have SSH (root)access.
If you have the Maemo Extra repository enabled and already installed rootsh the only thing we have to do is search for a package named openssh. This is a meta package which contains both client and server. We install this package and it will ask us to choose a root password. After setting this password the installation is finished. We now should be able to login with that password:
For extra security we could choose not to allow password authentication, but only publickey. To configure this on Debian/Ubuntu have a look at this article. What we do is:
Install the ssh client
client: apt-get install openssh-client
Generate the key-pair, a public-key and a private-key
client: ssh-keygen -t rsa
Copy the public key to the server (in this case the N900)