Skip to content

Instantly share code, notes, and snippets.

pragmaticivan /
Created Feb 1, 2018 — forked from ipepe/
Installing headless chrome on Ubuntu.
# from
# and
# and
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox
maxivak /
Last active May 12, 2021
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git
mdonkers /
Created Mar 29, 2017
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
Very simple HTTP server in python for logging requests
./ [<port>]
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
Brainiarc7 /
Last active May 15, 2021
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
eatnumber1 / renameat2.c
Last active Jan 20, 2021
Command-line tool to call renameat2(2)
View renameat2.c
#define _GNU_SOURCE
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <getopt.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
krmaxwell /
Last active Aug 31, 2016
Installing jekyll fresh on Ubuntu 14.04.1 LTS
plentz / nginx.conf
Last active May 15, 2021
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
willurd /
Last active May 16, 2021
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
dadoonet /
Created Dec 26, 2012
Backup Elasticsearch node
# Script to be placed in elasticsearch/bin
# Launch it from elasticsearch dir
# bin/backup indexname
# We suppose that data are under elasticsearch/data
# It will create a backup file under elasticsearch/backup
if [ -z "$1" ]; then
antivanov / webcrawler.js
Last active Dec 30, 2020
Simple PhantomJS-based web crawler library
View webcrawler.js
//PhantomJS based web crawler Anton Ivanov 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};