Skip to content

Instantly share code, notes, and snippets.

View jpbarbosa's full-sized avatar

JP Barbosa jpbarbosa

View GitHub Profile
@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 11, 2024 03:17
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@samueltc
samueltc / ubuntu16-apache2-mysql5-php4.md
Created August 22, 2018 13:10
Ubuntu 16.04, Apache 2.2, MySQL 5.0 and PHP 4.4
# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

apt-get update
apt-get upgrade
@ultimagriever
ultimagriever / heroku-config-set.sh
Last active February 10, 2017 13:30
Set Heroku config vars from .env file
# Usage: sh heroku-config-set.sh [/path/to/.env] [app-name]
ENV_FILE=$1
APP=$2
heroku config:set $(cat $ENV_FILE) -a $APP
@ultimagriever
ultimagriever / nginx.sh
Created June 28, 2016 18:54
Automatic Nginx Server Block Generation
# sh nginx.sh <app name>
APP=$1
if [[ $APP == "" ]]; then
echo "Please provide app name."
exit;
fi
NGINX_PATH=/usr/local/etc/nginx
cp $NGINX_PATH/sites-enabled/template.dev $NGINX_PATH/sites-enabled/$APP.dev
sed -i '' "s/app/$APP/g" $NGINX_PATH/sites-enabled/$APP.dev
echo "Config created for $APP"
@homam
homam / AWS_S3_File_Upload.js
Created January 27, 2014 10:08
How to upload files to AWS S3 with NodeJS SDK
var AWS = require('aws-sdk'),
fs = require('fs');
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
@plentz
plentz / nginx.conf
Last active March 31, 2024 18:40
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gucki
gucki / .irbrc
Created September 11, 2013 12:54
irb history per rails project
# ~/.irbrc
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 1000
if defined?(::Rails)
IRB.conf[:HISTORY_FILE] = File.join(ENV['PWD'], '.irb-history')
else
@BlakeGardner
BlakeGardner / install nano.sh
Last active March 21, 2024 13:39
Syntax highlighting in nano on Mac OS
# Last updated March, 2022 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "/opt/homebrew/share/nanorc/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@saetia
saetia / gist:1623487
Last active March 19, 2024 15:21
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat