Category Archives: Code

How to check if a string is valid utf-8

Every day (at least) I’m facing a problem: how to check if a string is valid in utf-8 ? So I wrote a little C program, that I put on my github. Just be aware that pure ASCII is valid … Continue reading

Posted in Code | 3 Comments

emacs: standard input is not a tty

Did you ever tried something like : $ find -name ‘*.c’ | xargs emacs or $ grep -rl snmp . | xargs emacs and got the error “emacs: standard input is not a tty” ? That’s normal, as the stdin … Continue reading

Posted in Code | 2 Comments

Automating GNU screen startup

At work I use GNU screen with one window per server (ssh connection), and when I loose my screen, it takes minutes to rebuild the naming and the ssh connections … So I searched and found a PHP version on … Continue reading

Posted in Code | 2 Comments

ashttp: vt100 screen scraping exported over HTTP

Originally wrote for logtop I just wrote a vt100 screen scraper that listen to a port and serve the screen over HTTP. Basically, you want a `top` (or logtop ;-) ) to be displayed in your website back office ? … Continue reading

Posted in Code, Python, Sysadmin, unix | 3 Comments

emacs: Highlighting errors for c, python, and other languages

Hi ! Today we’ll see how to highlight syntax errors in emacs, with exemples for C and Python. First you should learn about flymake-mode here : http://www.emacswiki.org/emacs/FlyMake In a nutshell Flymake is a minor mode to perform on the fly … Continue reading

Posted in Code, emacs, Python | Leave a comment