Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@flaschbier
flaschbier / mkpycurl.py
Last active April 18, 2019 21:50
Automates compiling a python-pycurl version with openssl instead of GnuTLS for Ubuntu and Raspbian following the recipe in Gist https://gist.github.com/aerickson/f15133a7e56b2d7f27e3. See this answer http://askubuntu.com/a/666868/184228 on Ask Ubuntu for details.
#!/bin/bash
#
# How to rebuild PycURL against OpenSSL on Ubuntu
# (tested for 14.04.2 now)
#
# This script implements the great Gist by aerickson:
# https://gist.github.com/aerickson/f15133a7e56b2d7f27e3
# feel free to use it anyway you like.
# Credits go to Andrew anyway :)
@nateberkopec
nateberkopec / 0.result.md
Last active January 18, 2024 11:20 — forked from tomfuertes/0.result.md
De-'Async Inject'ing Universal Analytics

De-'Async Inject' Universal Analytics

This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head> of your document

<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
  !function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
  ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
 ga('send', 'pageview');
@sage-oli-wood
sage-oli-wood / gist:70e0931f037ea0aac132
Created November 5, 2015 17:38
F.Ugly way to push TCP network stats into DataDog. Can be run from a crontab entry
#!/bin/bash -eux
// set $DATADOGKEY to your API key
DATE=$(date +%s)
HOSTNAME=`hostname`
cat /proc/net/sockstat | grep TCP | cut -d":" -f2 |sed 's/^ //g' | awk '{print $1, $2"\n"$3, $4"\n"$5,$6"\n"$7,$8"\n"$9,$10}' > /tmp/stats.tmp
while read LINE; do
METRIC=$(echo $LINE | cut -d" " -f1)
VALUE=$(echo $LINE | cut -d" " -f2)
curl -X POST -H "Content-type: application/json" \
@vnys
vnys / exiftool.md
Last active October 14, 2016 05:51
exiftool

Navngi filer med samme konvensjon som brukes av DropBox i Camera Upload.

cd <photo-directory>
exiftool "-FileName<CreateDate" -d "%Y-%m-%d %H.%M.%S%%-c.%%le" .
@adamzaninovich
adamzaninovich / neovim-setup.md
Last active January 18, 2025 07:36
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim
@frnhr
frnhr / .bash_profile
Created March 17, 2016 22:39
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@motleytech
motleytech / casper.md
Created June 21, 2016 01:00
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
@brandur
brandur / re-re-gh-ost.md
Last active August 22, 2024 22:02
RE: RE: gh-ost