Skip to content

Instantly share code, notes, and snippets.

@vallettea
vallettea / cncjs_install.sh
Created July 24, 2020 08:18
Install cncjs on raspberry pi
apt-get update -y
apt upgrade -y
apt-get install git
git clone https://github.com/creationix/nvm.git ~/.nvm
sudo echo "source ~/.nvm/nvm.sh" >> ~/.bashrc && sudo echo "source ~/.nvm/nvm.sh" >> ~/.profile
nvm install --lts
npm install npm@latest -g
npm install --unsafe-perm -g cncjs
npm install -g pm2
pm2 startup
@vallettea
vallettea / postgres.md
Last active August 24, 2018 12:37
postgres json queries

a few examples of advanced json queries in postgres

Here is the activity field shape (se select non empty fields):

select jsonb_pretty(activity::jsonb) from adverts where activity::jsonb ->> 'exactMatchesTitle' != '[]' and activity::jsonb ->> 'exactMatchesText' != '[]';
 {                                                                                                  +
     "exactMatchesText": [                                                                          +
         {                                                                                          +
             "id": 1146,                                                                            +
             "value": "delivery driver",                                                            +

in /etc/network/interfaces:

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual
@vallettea
vallettea / desimlock
Last active December 20, 2016 13:52
remove pin code on sim when default is 1234
ls -al /dev/tty.*
screen /dev/tty.usbmodem1411 115200
AT+CPIN="1234"
AT+CLCK="SC",0,"1234"
# http://dostmuhammad.com/blog/disable-pin-code-using-gsm-modem-at-commands/
@vallettea
vallettea / s3_size.sh
Created August 12, 2016 14:29
Get size of S3 bucket
aws s3 ls s3://immoviz --region=eu-central-1 --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}'
@vallettea
vallettea / koala_windows.md
Last active July 27, 2016 10:57
Installation koala sur windows 7 64bits

Install git

just dowload the installer here

Install prerequisits

Install python-c compiler from here and cython using:

Dowload MinGW-w64, extract it and copy is as MinGW at C:\.

@vallettea
vallettea / sftp.md
Created March 21, 2016 14:33
How to setup a secure ftp server on ubuntu.

Setting up ftp server on ubuntu

Install

apt-get install vsftpd openssh-server

Configure ftp

@vallettea
vallettea / sshfs.md
Created March 15, 2016 15:59
To edit files from your rpi directly on your mac

Install

brew install Caskroom/cask/osxfuse
brew install homebrew/fuse/sshfs

Usage

@vallettea
vallettea / vim.md
Last active April 14, 2021 15:05
Configure vim on mac

Install pathogen and use a proper directory structure

cd
mkdir -p .vim/{autoload,colors,syntax,plugin,spell,config}
mv .vimrc .vim/vimrc
ln -s .vim/vimrc .vimrc
cd ~/.vim
git clone https://github.com/tpope/vim-pathogen.git pathogen
cd autoload