Skip to content

Instantly share code, notes, and snippets.

View jpbarbosa's full-sized avatar

JP Barbosa jpbarbosa

View GitHub Profile
@AstralJohn
AstralJohn / Reset Udemy Progress.md
Last active March 19, 2025 15:23
Reset Udemy Progress

Reset Udemy Progress

Last Updated: 06/18/2024

Step 1. Go to the Udemy course in your browser

Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.

Step 2. Open browser console

You can do this with ctrl+shift+j and making sure the console tab is selected for chrome/brave

@nhtua
nhtua / 00.install-android-sdk.sh
Last active May 9, 2025 10:28
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 May 3, 2025 05:27
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 May 13, 2025 18:38
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 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 "'"$(brew --cellar nano)"'/*/share/nano/*.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
#