Skip to content

Instantly share code, notes, and snippets.

View ricventu's full-sized avatar
💭
don't run this at home

Riccardo Venturini ricventu

💭
don't run this at home
View GitHub Profile
@ricventu
ricventu / lsof.md
Created March 28, 2017 07:47
List open sockets and associated daemons on Linux
lsof -i
@ricventu
ricventu / mancert.md
Created March 28, 2017 07:52
manually installing certificates on linux
echo -n | openssl s_client -connect download.01.org:443 | \
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | \
sudo tee '/usr/local/share/ca-certificates/download_01_org.crt'

update-ca-certificates
@ricventu
ricventu / ubuntu-vmk.md
Created March 28, 2017 07:54
Installing virtual Kernel on Ubuntu Linux virtual machine
sudo apt-get install linux-virtual
sudo apt-get autoremove --purge linux-generic
sudo apt-get remove --purge linux-firmware
sudo update-grub
@ricventu
ricventu / ubuntu-php-nginx.md
Created April 2, 2017 13:21
Secure php and nginx production env on Ubuntu

in file: /etc/php5/fpm/php.ini

cgi.fix_pathinfo=0
expose_php=Off

in file: /etc/nginx/nginx.conf

server_tokens off;
@ricventu
ricventu / git2svn.md
Last active June 6, 2017 07:14
Import git repository into svn

Import git repository into svn

  1. git svn init svn://path/to/svn/repo/ -s
  2. git svn fetch
  3. git rebase origin/trunk
  4. git svn dcommit
@ricventu
ricventu / ssh_config
Last active September 21, 2017 08:50
ssh configuration
# ~/.ssh/config
Host sample
User user1
hostname sample.host.com
Port 2222
# disable host key checking
StrictHostKeyChecking no
Host sample2
@ricventu
ricventu / gitaliases.md
Last active June 5, 2019 14:23
Some useful git aliases

git config --global alias.co checkout

git config --global alias.st status

git config --global alias.graph "log --graph --oneline --all"

@ricventu
ricventu / event_handler.agi.php
Last active September 21, 2017 08:51
Handling Asterisk Manager events from AGI script in PHP
#!/usr/bin/php -q
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpagi.php');
$AGI = new AGI();
$ASM = $AGI->new_AsteriskManager();
$ASM->connect();
@ricventu
ricventu / .vimrc
Last active June 1, 2019 08:09
Vim config file
" ~/.vimrc
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
@ricventu
ricventu / wav2gms.sh
Created September 27, 2017 09:47
Bash command to convert .wav files to .gsm format compatible with Asterisk
for a in *.wav; do sox -v 0.3 "$a" -r 8000 -c1 "$a.gsm" resample -ql; done