Skip to content

Instantly share code, notes, and snippets.

@kevin39
kevin39 / Proxmox reload services
Last active February 5, 2025 16:36
Proxmox reload services properly (services order is important)
service pve-cluster restart && service pvedaemon restart && service pvestatd restart && service pveproxy restart
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@Asraful-Haque
Asraful-Haque / tracker
Last active August 10, 2024 14:19
Torrent: Torrent Tracker List
udp://p4p.arenabg.ch:1337
udp://p4p.arenabg.com:1337
http://bttracker.crunchbanglinux.org:6969/announce
http://tracker.aletorrenty.pl:2710/announce
udp://torrent.gresille.org:80/announce
udp://glotorrents.pw:6969/announce
udp://tracker.trackerfix.com:80/announce
udp://www.eddie4.nl:6969/announce
udp://tracker.leechers-paradise.org:6969
http://retracker.kld.ru:2710/announce
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active April 18, 2025 13:48
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@jult
jult / blockpeers.sh
Last active December 28, 2024 13:59
blocking p2p peer snoopers and evil corp (for Tixati IP filter and such)
#!/bin/sh
# This script runs every other night at 04:56 CET on a webserver I maintain
# Results are always at: https://jult.net/block.txt ( or https://jult.net/block.txt.gz )
# And much smaller, stripped of BS; https://jult.net/bloc.txt
# For use in Tixati IP filter: https://jult.net/bloc.txt.gz !!!
# And finally a txt file with just the bold IP-ranges: https://jult.net/bl.txt (or https://jult.net/bl.txt.gz )
# Download open block-lists, unpack, filter:
curl -s https://www.iblocklist.com/lists.php | grep -A 2 Bluetack | xargs wget -qO - --limit-rate=500k | gunzip -f | egrep -v '^#' > /tmp/xbp
@vanphuong12a2
vanphuong12a2 / textract.py
Created January 18, 2016 13:25
Extract text from files with common file extensions.
"""
Extract text from files with common file extensions. (inspried by textract <http://textract.readthedocs.org/en/latest/>)
Modified: Dec 2015
System requirement:
+ catdoc/catppt for doc/ppt extract <http://www.wagner.pp.ru/~vitus/software/catdoc/>
"""
import zipfile
import PyPDF2
from subprocess import Popen, PIPE
from pptx import Presentation
@celly
celly / gist:1591cf9305734812baad
Last active February 26, 2024 10:30
Personal Deny list for Pi-Hole
#
# link: https://gist.githubusercontent.com/celly/1591cf9305734812baad/raw/
#
# Add to you /usr/local/bin/gravity.sh file under sources=
#
# samsung 'smart tv'
127.0.0.1 log-1.samsungacr.com
127.0.0.1 log-2.samsungacr.com
127.0.0.1 notice.samsungcloudsolution.com
@miglen
miglen / web2csv.py
Created January 5, 2016 09:18
Dead simple {for devs} python crawler (script) for extracting structured data from any website into CSV
#!/bin/env/python
#
# Source: http://blog.webhose.io/2015/08/16/dead-simple-for-devs-python-crawler-script-for-extracting-structured-data-from-any-almost-website-into-csv/
import sys, thread, Queue, re, urllib2, urlparse, time, csv
### Set the site you want to crawl & the patterns of the fields you want to extract ###
siteToCrawl = "http://www.amazon.com/"
fields = {}
fields["Title"] = '<title>(.*?)</title>'
fields["Rating"] = 'title="(S+) out of 5 stars"'
@nk23x
nk23x / HOWTO.get-m3u-from-soundcloud
Created October 28, 2015 20:06
get m3u playlist from soundcloud sets
## get playlist items from soundcloud
youtube-dl --no-progress -g -e --get-duration https://soundcloud.com/nok/sets/tracks-tracks-tracks >> /tmp/nk23x-soundcloud-trackstrackstracks.txt
## make m3u playlist
echo "#EXTM3U" > nk23x-soundcloud-trackstrackstracks.m3u; cat /tmp/nk23x-soundcloud-trackstrackstracks.txt| perl -p0e 's/(.*)\nhttp(.*)\n([0-9:]{4,15})/#EXTINF:-1,$1 ($3)\nhttp$2/gm;' >> nk23x-soundcloud-trackstrackstracks.m3u
## enjoy :)
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active December 29, 2024 07:04
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: