Skip to content

Instantly share code, notes, and snippets.

View nerdCopter's full-sized avatar

nerdCopter nerdCopter

View GitHub Profile
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@DrLulz
DrLulz / mpv-commands.lua
Created June 1, 2015 14:48
MPV zoom, rotate, and pan. Add to mpv scripts folder.
-- ZOOM
function zoom_in()
zoom = mp.get_property("video-zoom")
zoom_to = zoom + 0.1
mp.set_property("video-zoom", zoom_to)
end
function zoom_out()
zoom = mp.get_property("video-zoom")
zoom_to = zoom - 0.1
mp.set_property("video-zoom", zoom_to)
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active June 4, 2024 10:08
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@franciscocpg
franciscocpg / purge-old-kernels
Last active May 19, 2022 20:18
This scripts remove old kernels and should keep the latest 2 kernels (or you can pass the flag --keep n to keep more)
#!/bin/bash
# Install purge-old-kernels script for purging old kernels from apt-get
# This utility was extracted from bikeshed (sudo apt-get install bikeshed, http://packages.ubuntu.com/precise/misc/bikeshed)
FILE_NAME=purge-old-kernels
BIN_FOLDER=/usr/bin
echo -e '#!/bin/sh
#
# purge-old-kernels - remove old kernel packages
# Copyright (C) 2012 Dustin Kirkland <kirkland@ubuntu.com>
@ejmr
ejmr / git-branch-show-description.sh
Last active May 29, 2022 07:41
Show the Description for the Current Branch
#!/bin/bash
#
# You can use `git branch --edit-description` to write a description
# for a branch, but Git provides no simple command to display that
# description. The "easiest" way to see it is via `git config --get
# branch.BRANCH_NAME.description`.
#
# This script automates that process and is meant to be used as
# a Git alias to provide a shorter command for showing the
# description of the current branch.
@gwatts
gwatts / github-release-stats.py
Last active March 22, 2021 07:22
Formats the release download stats for a Github project.
#!/usr/bin/python
# Little script to display file download statistics for
# the published releases of a Github project.
#
# (c) Gareth Watts 2015
# <gareth@omnipotent.net>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@jtilly
jtilly / install-gcc-4.9.3.sh
Last active April 11, 2024 07:28
Install GCC 4.9.3
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
@kn9ts
kn9ts / GPLv3.md
Last active March 8, 2024 07:26
GPLv3 explained

GPL3 LICENSE SYNOPSIS

TL;DR* Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
@santisbon
santisbon / Update-branch.md
Last active March 21, 2024 15:50
Deploying from #Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.