Skip to content

Instantly share code, notes, and snippets.

View ljvicente's full-sized avatar
🧑‍🍳
Cooking

Leo Vicente ljvicente

🧑‍🍳
Cooking
View GitHub Profile
alias Ga='git add'
alias Gs='git status'
alias Gc='git commit'
alias Gca='git commit -am '
alias Gh='git push'
alias Gf='git fetch'
alias Gl='git pull'
alias Gm='git merge'
alias Go='git checkout'
alias Gb='git branch && git branch -r'
@ljvicente
ljvicente / ovpn-install.sh
Created July 28, 2017 12:32
OpenVPN one step script
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
wget ftp://user:pass@example.com/file/here.zip
du -h /path/to/directory -d 1
@ljvicente
ljvicente / mogrify.sh
Last active July 26, 2017 05:58
mogrify
# portrait
mogrify -fuzz 15% -trim +repage *.jpg && mogrify -resize 800x1100 *.jpg && mogrify -extent 1000x1300 -gravity Center -fill white *.jpg
# square
mogrify -fuzz 15% -trim +repage *.jpg && mogrify -resize 1000x1000 *.jpg && mogrify -extent 1200x1200 -gravity Center -fill white *.jpg
mogrify -fuzz 15% -trim +repage *.jpg
mogrify -resize 500x600 *.jpg
mogrify -geometry x1200 *.jpg
mogrify -extent 1000x1300 -gravity Center -fill white *.jpg
@ljvicente
ljvicente / IPTABLE accept
Last active April 12, 2016 12:47
My CC Pastebin
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
@ljvicente
ljvicente / gulpfile.js
Created April 5, 2016 20:04 — forked from torgeir/gulpfile.js
Example gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@ljvicente
ljvicente / 01-gulpfile.js
Created April 5, 2016 20:03 — forked from markgoodyear/01-gulpfile.js
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@ljvicente
ljvicente / tinyurl.php
Created July 12, 2015 07:52
TinyURL shortener snippet
<?php
function get_tiny_url($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
@ljvicente
ljvicente / install.sh
Last active August 29, 2015 14:19 — forked from JeffreyWay/install.sh
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug