Skip to content

Instantly share code, notes, and snippets.

View ephdtrg's full-sized avatar
💭
🐍

Euphemia Deathridge ephdtrg

💭
🐍
View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active April 18, 2024 01:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@agarzon
agarzon / installSourceCodePro.sh
Last active December 28, 2021 14:58
Install Source Code Pro fonts on Linux
version=1.017R
echo "\n* Downloading version $version of source code pro font"
rm -f SourceCodePro_FontsOnly-$version.zip
rm -rf SourceCodePro_FontsOnly-$version
wget https://github.com/downloads/adobe/source-code-pro/SourceCodePro_FontsOnly-$version.zip
echo "\n* Unziping package"
unzip SourceCodePro_FontsOnly-$version.zip
mkdir -p ~/.fonts
#!/bin/bash
CUR_PATH=`pwd`
ZFS_CHECK_OUTPUT=$(zfs get type $CUR_PATH 2>&1 > /dev/null) > /dev/null
if [[ $ZFS_CHECK_OUTPUT == *not\ a\ ZFS* ]]
then
IS_ZFS=false
else
IS_ZFS=true
fi
@mamonu
mamonu / qcow2vdi.sh
Last active March 8, 2024 04:15
convert a qcow2 vm to a VirtualBox vm format
qemu-img convert -O vdi gnome.qcow2 gnome.vdi
#if its a raw image then:
VBoxManage convertdd opnstk.raw VBox.vdi --format VDI
@victorono
victorono / remove_duplicates.py
Last active April 14, 2024 03:02
Django - remove duplicate objects where there is more than one field to compare
from django.db.models import Count, Max
unique_fields = ['field_1', 'field_2']
duplicates = (
MyModel.objects.values(*unique_fields)
.order_by()
.annotate(max_id=Max('id'), count_id=Count('id'))
.filter(count_id__gt=1)
)
@enzinier
enzinier / install_font_adobe_source_code_pro.sh
Created March 4, 2017 03:38
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@jbeda
jbeda / 01 Install Unison Linux
Last active September 8, 2023 07:47
Unison install
# linux
UNISON_VERSION=2.48.4
sudo apt-get -y install inotify-tools ocaml-nox build-essential
curl -L https://github.com/bcpierce00/unison/archive/${UNISON_VERSION}.tar.gz | tar zxv -C /tmp
cd /tmp/unison-${UNISON_VERSION}
sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c
make UISTYLE=text NATIVE=true STATIC=true
cp src/unison src/unison-fsmonitor ~/bin
# You should modify your path to include ~/bin
@cacheflowe
cacheflowe / remove-twitter-likes.js
Last active January 27, 2024 13:29
Remove your Twitter likes
// [Noted in the comments below on 2023-10 - this script might not work very well anymore due to Elon ruining Twitter]
// [Updated 2021-01-18 w/new selectors]
// go to your account Likes page and run this in the console:
function scrollToLoadMore() {
// keep scrolling if twitter tries to stop loading more.
// scroll up, then down to force infinite load.
window.scrollTo(0, 0);
setTimeout(function() {
window.scrollBy(0, 9999999999);
@loadedsith
loadedsith / keymap.c
Last active November 10, 2020 18:24
Backlight responds to layers
bool has_layer_changed = true;
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
static uint8_t old_layer = 0;
if (old_layer != layer) {
has_layer_changed = true;
old_layer = layer;
}