Skip to content

Instantly share code, notes, and snippets.

View mad4j's full-sized avatar
🤔
revisioning old projects

Daniele Olmisani mad4j

🤔
revisioning old projects
View GitHub Profile
@mad4j
mad4j / hellow.c
Last active December 22, 2015 12:58
simple Hello World! snippet
#include <stdio.h>
int main(int argc, char* argv[]) {
printf("HelloWorld!!\n");
return 0;
}
@mad4j
mad4j / ma.R
Created September 28, 2013 16:02
simple mobile average in R
ma <- function(x,n=5){filter(x,rep(1/n,n), sides=2)}
@mad4j
mad4j / dropbear
Last active April 11, 2024 07:13
activating dropbear on embedded linux
Manual installation
1. copy dropbearmultin in /usr/sbin
2. create dropbearmulti aliases (call ./dropbearmulti)
Dropbear multi-purpose version 0.51
Make a symlink pointing at this binary with one of the following names:
'dropbear' - the Dropbear server
'dbclient' or 'ssh' - the Dropbear client
'dropbearkey' - the key generator
'dropbearconvert' - the key converter
@mad4j
mad4j / svn-repository
Last active December 31, 2015 12:49
recovering revision number from SVN repository
#returns version (append 'M' if local workspace is modified)
svnversion
#otherwise
svn info <repo-url> --username <user> | grep 'Last Changed Rev' | awk '{ print $4; }'
@mad4j
mad4j / mac_change.c
Created February 7, 2014 14:54
How to change MAC using ioctl
#include
#include <sys/ioctl.h>
#include
#include
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <net/if.h>
#include
#include
@mad4j
mad4j / networkcopy.sh
Last active February 26, 2016 07:18
use tar command through network over ssh session
#from local to remote with local compression
#(less bandwidth, more local processing)
tar zcvf - /home/app | ssh root@192.168.1.1 "cat > /tmp/backup.tar.gz"
#from local to remote with remote compression
#(more bandwidth, less local processing)
tar cvf - /home/app | ssh root@192.168.1.1 "gzip > /tmp/backup.tar.gz"
@mad4j
mad4j / tar-essential.sh
Last active August 29, 2015 14:01
essential usage of tar command
#create a gzip compressed archive
tar -czvf archive.tgz source1/ [source2/ ...]
#extract files from a gzip compressed archive
tar -xzvf archive.tgz
# c: create archive
# x: extract archive
# v: verbose
# z: compress/uncompress using gzip (*.tar.gz or *.tgz files)
@mad4j
mad4j / prev_folder.sh
Created May 25, 2014 16:57
return back to the previous folder
#back to the previous folder
cd -
@mad4j
mad4j / threads.sh
Created May 28, 2014 16:31
view information regarding thread priorities
#visualizza thread creati dal processo pid
pidstat -p <pid> -t
#visualizza priorita' associata a processo/thread
chrt -p <pid>
0 PRINT CHR$(205.5+RND(.));:GOTO