chrooted sftp

chrooted sftp: $ sudo adduser –shell /bin/false pietjepuk password: $ /home $ sudo chown root:pietjepuk /home/pietjepuk/ $ sudo chmod 755 /home/pietjepuk/ $ sudo vi /etc/ssh/sshd_config comment de regel waar sftp server wordt bepaald: #Subsystem sftp /usr/lib/openssh/sftp-server En voeg het volgende onderaan toe: Subsystem sftp internal-sftp Match User pietjepuk ChrootDirectory %h ForceCommand internal-sftp X11Forwarding no AllowTCPForwarding […]

json kladblok

http://api.jquery.com/jquery.getjson/ $.getJSON( “ajax/test.json”, function( data ) { var items = []; $.each( data, function( key, val ) { items.push( “ ” + val + “ ” ); }); $( “ “, { “class”: “my-new-list”, html: items.join( “” ) }).appendTo( “body” ); }); http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery jQuery(‘ ‘, { id: ‘foo’, href: ‘http://google.com’, title: ‘Become a Googler’, rel: […]

bulk update with exception handling

CREATE TABLE tmp_table (aaa VARCHAR2(100) NOT NULL); DECLARE TYPE t_varchar IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER; a_varchar t_varchar; e_bulk_errors EXCEPTION; t_error_index PLS_INTEGER; PRAGMA EXCEPTION_INIT(e_bulk_errors,-24381); BEGIN a_varchar(1) := ‘aaa’; a_varchar(2) := NULL; a_varchar(4) := NULL; a_varchar(5) := ‘eee’; a_varchar(7) := ‘fff’; a_varchar(8) := ‘ggg’; a_varchar(9) := NULL; FORALL i IN INDICES OF a_varchar SAVE EXCEPTIONS […]

timezones

Learned something new today about timezones date with timezone indicator can be visualized as 2014-01-28T10:35:08+00:00 or 2014-01-28T10:35:08Z That Z is the same as +00:00 also called Zulu timezone. Never have been in the military service so didn’t know about that zulu thing. wiki1 wiki2  

undress raspbian

My raspberry pi with 64 gig sd card running raspbian was a bit unstable. Sometimes it took 4 or 5 tries to get it booted. And it crashed once in a while. Finally I got out of this misery by stopping the dbus. $sudo service dbus stop and prevent starting it again at next boot […]

where to find c headers

gcc lcdtest.c -Isrc/ -L./libpifacecad/ -lpifacecad -L./libmcp23s17/ -lmcp23s17 -o lcdtest fails into: lcdtest.c:1:23: fatal error: pifacecad.h: No such file or directory compilation terminated. let’s google: #include tells GCC to look where it finds the standard C headers, probably not where you have your header. #include “pifacecad.h tells GCC to look for headers in the current working […]

writing a lcd display program in c

Let’s start with the final part: how to compile: gcc -c mpddispl.c -o mpddispl.o gcc mpddispl.o /usr/lib/libmpdclient.so -o mpddispl Now the beginning. I bought a nifty display for my raspberry pi running mpd: a piface with a display:   Now what i want is just simple. Show the streamname and current song that is mpd […]

nfs mount point directory mess

Had to share some very specific directories from this machine by nfs. So I created a new directory in root: /nfsshare In here I created some mount points: Let’s say I have this directory /var/lib/users/xxx/bla/zzz containing all documents to be shared. in nfshare i create a new directory zzz with sudo mount -o bind /var/lib/users/xxx/bla/zzz […]

raspbian stripping

The raspberry pi sitting in my parents cupboard only handles some ssh and rsync stuff. I installed the default raspbian image. Now I will strip this device to a minimum bare state. This means, getting rid of all X stuff (it’s headless). First check some processes ($ps aux) I think not really needed root 1312 […]

Mount noatime or relatime

On my rasdpberry pi when i mount my usb disk (ext3 filesystem) just with mount /dev/sda1 /mnt/disk1 the disk gets io every 5 seconds jdbd2 shows up in iotop. So I remounted with -o noatime. Now the disk keeps quiet. Only backdraft is now files dont get a accesstime recorded. Now I read about relatime […]