Skip to content

Instantly share code, notes, and snippets.

View YourFriendCaspian's full-sized avatar
🙃
I'm sure I'll be slow to respond so don't be mad.

yourfriendcaspian YourFriendCaspian

🙃
I'm sure I'll be slow to respond so don't be mad.
View GitHub Profile
@YourFriendCaspian
YourFriendCaspian / code.gs
Created March 30, 2019 07:35 — forked from juzim/code.gs
Google apps script for parsing the URL of the free ebook from the packtpub newsletter
function extractPacktpubUrl() {
try {
var ss = SpreadsheetApp.getActiveSheet();
var label = GmailApp.getUserLabelByName("packt_free_ebook");
var threads = label.getThreads();
if (threads[0] == undefined || threads[0].getMessages()[0] == undefined) {
Logger.log('No valid message found');
# Redirect all http traffic to https
server {
listen 80;
return 301 https://$host$request_uri;
}
# Portainer Upstream
upstream portainer {
server YOUR.PI.IP.ADDRESS:9000;
keepalive 32;
version: '2.1'
services:
grafana:
container_name: grafana
image: proxx/grafana-armv7
user: "1000"
ports:
- 3000:3000
volumes:
- /opt/grafana:/etc/grafana:rw
@YourFriendCaspian
YourFriendCaspian / tmux.conf
Created March 22, 2019 20:04 — forked from spicycode/tmux.conf
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
@YourFriendCaspian
YourFriendCaspian / convert.py
Created March 21, 2019 16:45 — forked from rednebmas/convert.py
Convert sqlite3 dump to mysql importable statements
import re, fileinput
print 'SET FOREIGN_KEY_CHECKS=0;'
def main():
for line in fileinput.input():
process = False
for nope in ('BEGIN TRANSACTION','COMMIT',
'sqlite_sequence','CREATE UNIQUE INDEX'):
if nope in line: break
@YourFriendCaspian
YourFriendCaspian / fix-infinality.md
Created March 15, 2019 05:14 — forked from cryzed/fix-infinality.md
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@YourFriendCaspian
YourFriendCaspian / Monokai.colorscheme
Created March 15, 2019 05:04 — forked from wdullaer/Monokai.colorscheme
Monokai Konsole Colourscheme
[Background]
Color=40,40,40
[BackgroundIntense]
Color=40,40,40
[Color0]
Color=73,72,62
[Color0Intense]
@YourFriendCaspian
YourFriendCaspian / tmux-cheatsheet.markdown
Created February 4, 2019 08:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@YourFriendCaspian
YourFriendCaspian / replaceFilenameWhitespace.sh
Created January 31, 2019 09:29 — forked from timisenheim/replaceFilenameWhitespace.sh
Replace spaces in filenames with underscores
find -name "* *" -type d | rename 's/ /_/g' # directories
find -name "* *" -type f | rename 's/ /_/g' # files
@YourFriendCaspian
YourFriendCaspian / replaceSpaces.pl
Created January 31, 2019 09:26 — forked from mgcon/replaceSpaces.pl
replace spaces in file names with underscores
#!/usr/bin/perl
# replace spaces in all filenames with underscores
$dir = ".";
opendir(DIR, $dir) || die "Can't open $dir\n";
for (readdir(DIR)) {
next if $_ eq '.';
next if $_ eq '..';
next if $_ eq 'lost+found';