Skip to content

Instantly share code, notes, and snippets.

@dargmuesli
dargmuesli / hetzner-start.sh
Last active November 12, 2020 16:39
Initial setup script for Hetzner servers.
# Run
# wget https://gist.githubusercontent.com/dargmuesli/645a4d51ab1806ebfb3329fb05637318/raw -O hetzner-start.sh && chmod +x hetzner-start.sh && ./hetzner-start.sh
sudo apt-get update \
&& sudo apt-get -y dist-upgrade \
&& sudo apt-get -y install git vim
passwd
echo "username: "
read username
useradd -U -G users,sudo -m -s /bin/bash "$username"
@ABeltramo
ABeltramo / weather.30m.py
Last active September 2, 2019 10:54
BitBar Weather with icons
#!/usr/bin/python
# -*- coding: utf-8 -*-
# <bitbar.title>Weather</bitbar.title>
# <bitbar.version>v3.5.0</bitbar.version>
# <bitbar.author>Daniel Seripap</bitbar.author>
# <bitbar.author.github>seripap</bitbar.author.github>
# <bitbar.desc>Detailed weather plugin powered by DarkSky with auto location lookup. Supports metric and imperial units. Needs API key from https://darksky.net/dev/.</bitbar.desc>
# <bitbar.image>https://cloud.githubusercontent.com/assets/683200/16276583/ff267f36-387c-11e6-9fd0-fc57b459e967.png</bitbar.image>
# <bitbar.dependencies>python</bitbar.dependencies>
@SkaTeMasTer
SkaTeMasTer / kali-linux-region-BO-wifi-txpower-unlocker.sh
Last active December 29, 2018 20:49
unlock power TX rang in kali
#!/bin/bash
#title: kali-linux-region-BO-wifi-txpower-unlocker.sh
#description: Unlocks the wifi txpower of the 2.4Ghz band of the BO region
#author: Hiruna Wijesinghe https://github.com/hiruna/wifi-txpower-unlocker/
#date: 13/05/2017
# |\ /|\__ __/( ____ \\__ __/ ( ____ )( ___ )|\ /|( ____ \( ____ ) \__ __/|\ /|
# | ) ( | ) ( | ( \/ ) ( | ( )|| ( ) || ) ( || ( \/| ( )| ) ( ( \ / )
# | | _ | | | | | (__ | | | (____)|| | | || | _ | || (__ | (____)| | | \ (_) /
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active August 21, 2024 03:30
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@tom--
tom-- / Random bytes, ints, UUIDs in PHP.md
Last active February 11, 2023 06:14
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@jeffgca
jeffgca / output.json
Last active August 17, 2023 18:32
Get 10k extensions from the chrome web store.
[
"https://chrome.google.com/webstore/detail/ballloon-for-chrome/kbmligehjhghebleanjcmenomghmcohn",
"https://chrome.google.com/webstore/detail/shine-for-reddit/acoiihnnfofnpbnofdcgcapbjlcopifa",
"https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk",
"https://chrome.google.com/webstore/detail/highly-highlighter/hjpahjhcglfdopbholajmhpamgblhjhg",
"https://chrome.google.com/webstore/detail/screencastify-screen-vide/mmeijimgabbpbgpdklnllpncmdofkcpn",
"https://chrome.google.com/webstore/detail/sms-from-gmail-facebook-m/iffdacemhfpnchinokehhnppllonacfj",
"https://chrome.google.com/webstore/detail/wot-web-of-trust-website/bhmmomiinigofkjcapegjjndpbikblnp",
"https://chrome.google.com/webstore/detail/mega/bigefpfhnfcobdlfbedofhhaibnlghod",
"https://chrome.google.com/webstore/detail/time-is-money/ooppbnomdcjmoepangldchpmjhkeendl",
@ficapy
ficapy / google_chrome_webstore_devtools_users_rank.py
Created October 27, 2015 12:21
谷歌浏览器应用商店使用人数排行 P.S 因木有代理 使用单线程执行,有极少部分请求被ban没有得到结果
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ficapy
# Create: '15/10/27'
from pyquery import PyQuery as pq
from operator import attrgetter
from concurrent.futures import ThreadPoolExecutor, as_completed
from operator import methodcaller
import requests
@protrolium
protrolium / wget.md
Last active March 8, 2024 01:46
wget commands

Download Only Certain File Types Using wget -r -A

You can use this under following situations:

  • Download all images from a website
  • Download all videos from a website
  • Download all PDF files from a website

$ wget -r -A.pdf http://url-to-webpage-with-pdfs/

@pklaus
pklaus / hist_to_db.py
Last active December 23, 2021 16:39
Store your Bash history in an SQLite database with this Python script.
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
""" Store all entered bash commands ('the history') in a database
http://blog.philippklaus.de/2015/04/enhancing-and-enlarging-the-bash-history/
"""
import sqlite3
from os import path, makedirs
import sys
@greatghoul
greatghoul / manifest.json
Last active October 20, 2023 16:48
Chrome Extension Sample - detect if an extension is installed.
{
"name": "Detect if an extension installed",
"description": "Detect if an extension installed",
"version": "0.1",
"manifest_version": 2,
"permissions": [
"management"
],
"browser_action": {
"default_popup": "popup.html"