Skip to content

Instantly share code, notes, and snippets.

View 5a494d's full-sized avatar
🌴
On vacation

5a494d 5a494d

🌴
On vacation
View GitHub Profile
@5a494d
5a494d / find.sh
Created September 23, 2021 03:18 — forked from gr1ev0us/find.sh
Cheatsheet for find linux
# List of cheatsheet for linux find.
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml
# basic 'find file' commands
# --------------------------
find / -name foo.txt -type f -print # full command
find / -name foo.txt -type f # -print isn't necessary
find / -name foo.txt # don't have to specify "type==file"
find . -name foo.txt # search under the current dir
find . -name "foo.*" # wildcard
@5a494d
5a494d / docker-aliases.sh
Created August 28, 2021 21:46 — forked from mspronk/docker-aliases.sh
Useful Docker Aliases
function help-fn {
echo "`cat <<EOF
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
@5a494d
5a494d / clean.sh
Created August 4, 2020 19:21 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@5a494d
5a494d / gist:f6990276ff411ff60d36c4513b0f20eb
Created April 9, 2019 03:14 — forked from bkemper/gist:ca6ac68b174a047b5ccde3930c8568dc
How to edit a commit with interactive rebase

While on a branch with a couple of commits, you can edit a commit with interactive rebase. This should be used sparingly and only on branches and never on master.

  1. Checkout the branch

$ git checkout my-branch

  1. Get the ref of the commit that you want to edit from the commit log. (e.g. 67b191fc62eda52b5b208cc4de50df7144a03171)

$ git log

@5a494d
5a494d / gist:4ece221a93b134d9a7b191c9aa5238fe
Created December 11, 2018 16:12 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@5a494d
5a494d / setting-up-babel-nodemon.md
Created October 12, 2018 20:31 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@5a494d
5a494d / template_lambda.cc
Created September 18, 2018 14:28 — forked from emaxerrno/template_lambda.cc
template_lazy_closures.cc
#include <type_traits>
#include <iostream>
// This template is called 'or_combinator'
// it takes 2 function templates 'func1' , and 'func2'
// the arguments to each type function is template<typename>
// which means any typename
// you invoke them via func1<T>::value
// but they aren't instantiated until you ask for or_combinator<>::lambda<>::value
@5a494d
5a494d / btree.cpp
Created September 18, 2018 14:13 — forked from toboqus/btree.cpp
Binary tree implementation in c++
#include <iostream>
using namespace std;
struct node{
int value;
node *left;
node *right;
};
@5a494d
5a494d / install_monaco_font.sh
Created October 18, 2017 15:30 — forked from rogerleite/install_monaco_font.sh
Install Monaco font in Linux
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@5a494d
5a494d / create_laravel_app.sh
Last active October 12, 2017 13:51 — forked from connor11528/create_laravel_app.sh
Create a new Laravel application
#!/bin/bash
composer create-project laravel/laravel $1 --prefer-dist
cd $1
composer install
node install
touch README.md
cp .env.example .env
git init
git add -A