Skip to content

Instantly share code, notes, and snippets.

View nikicat's full-sized avatar
🏠
Working from home

Nik B nikicat

🏠
Working from home
View GitHub Profile
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@stonegao
stonegao / gist:2366309
Created April 12, 2012 10:24 — forked from lardissone/gist:2152225
Nginx config file to serve static file over POST
server {
listen 80;
client_max_body_size 4G;
access_log /var/sites/webapp/logs/access.maintenance.log;
error_log /var/sites/webapp/logs/error.maintenance.log info;
server_name api.webapp.com;
# this guy redirects any path to /api.json
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@oroce
oroce / nginx.conf
Created January 31, 2014 20:40
nginx config for using grafana, elasticsearch and graphite with authentication.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@rayshan
rayshan / travis-ci-script.sh
Last active December 22, 2015 09:25 — forked from kzap/gist:5819745
mkdir ~/travis-ci-key && cd ~/travis-ci-key
# generate your private key
ssh-keygen -t rsa -f travis-ci-key
# put the public key on the server you will be connecting to
cat travis-ci-key.pub | ssh user@123.45.56.78 "cat >> ~/.ssh/authorized_keys"
# generate the password/secret you will store encrypted in the .travis.yml and use to encrypt your private key
cat /dev/urandom | head -c 10000 | openssl sha1 > ./secret
@wolever
wolever / histogram.sql
Last active April 19, 2023 20:28
Functions to create and draw histograms with PostgreSQL.
-- Functions to create and draw histograms with PostgreSQL.
--
-- psql# WITH email_lengths AS (
-- -# SELECT length(email) AS length
-- -# FROM auth_user
-- -# LIMIT 100
-- -# )
-- -# SELECT * FROM show_histogram((SELECT histogram(length, 0, 32, 6) FROM email_lengths))
-- bucket | range | count | bar | cumbar | cumsum | cumpct
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------
@pwldp
pwldp / load_iou_to_pgsql.py
Created May 19, 2014 10:22
Load mac vendor file oui.txt (from: http://standards.ieee.org/develop/regauth/oui/oui.txt) to PotgreSQL
#!/usr/bin/env python
#
# Scripts download oui.txt from web and load data to PostgreSQL database.
#
# Dariusz Pawlak <pawlakdp@gmail.com>
# 2014.05.16
#
#
import re
import urllib
@boodle
boodle / Making Apple Developer certificates on Linux.md
Last active May 5, 2024 09:07
Making Apple Developer certificates on Linux
  1. Create a new directory;
mkdir Apple\ Enterprise
cd Apple\ Enterprise
  1. Generate a certificate signing request
openssl req -nodes -newkey rsa:2048 -keyout ios_enterprise.key -out CertificateSigningRequest.certSigningRequest
@joepie91
joepie91 / vpn.md
Last active June 21, 2024 14:42
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.