Skip to content

Instantly share code, notes, and snippets.

View thiagoguarnieri's full-sized avatar
Always Available

Thiago Guarnieri thiagoguarnieri

Always Available
View GitHub Profile
thiagoguarnieri / samba.txt
Last active November 14, 2022 20:13
create simple share in samba for OPL
View samba.txt
sudo apt-get install samba cifs-utils
#create samba user
sudo smbpasswd -a myuser
#configure samba
mousepad /etc/samba/smb.conf
client min protocol = NT1
thiagoguarnieri / gist:8ede26bebd23944d63befbb0696b65c7
Created August 11, 2019 12:19
Using rsync to transfer a file from/to a server using two hop SSH
View gist:8ede26bebd23944d63befbb0696b65c7
# Command used to send a file to a remote server B only reachable through a remote server A
# Local <----> A <----> B
# receive
rsync -av --append -e 'ssh -o "ProxyCommand ssh user@server_A exec nc %h %p 2>/dev/null"' user@server_B:/path/source.file destination.file
# send
rsync -av --append -e 'ssh -o "ProxyCommand ssh user@server_A exec nc %h %p 2>/dev/null"' destination.file user@server_B:/path/source.file
thiagoguarnieri / installation.txt
Last active June 16, 2016 00:27
MongoDB PHP Installation and operation (Ubuntu 14.04)
View installation.txt
#install mongo db
sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org
#install pecl
sudo apt-get install php5-dev php5-cli php-pear
thiagoguarnieri / spotify_token.php
Created March 22, 2016 13:51
Get Spotify Access Token (client credentials) with PHP and cURL
View spotify_token.php
//based on
$client_id = 'your client id';
$client_secret = 'your client secret';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);