Skip to content

Instantly share code, notes, and snippets.

View surfaceflinger's full-sized avatar
🍃
WOLNEKONOPIE

surfaceflinger

🍃
WOLNEKONOPIE
View GitHub Profile
@vbajpai
vbajpai / opkgclean.sh
Last active March 5, 2024 17:06
If opkg runs out of space, it will not remove the files it was installing. Run this custom script in order recover the space by removing these files and the installed dependencies.
#!/bin/sh
#takes one argument/parameter: the name of the package which didn't install correctly and should be removed along with its dependencies
#do opkg update first
#example: ./opkgremovepartlyinstalledpackage.sh pulseaudio-daemon
#get list of all packages that would be installed along with package x
opkg update
PACKAGES=`opkg --force-space --noaction install $1 | grep http | cut -f 2 -d ' ' | sed 's/.$//'`
for i in $PACKAGES
do
@dschanoeh
dschanoeh / imapfilter-conf.lua
Last active December 9, 2021 06:00
My imapfilter configuration
options.timeout = 20
options.subscribe = true
account1 = IMAP {
server = 'server',
username = 'username',
password = 'password',
}
-- Twitter
@rosstimson
rosstimson / pf.conf
Last active August 14, 2022 12:31
Basic FreeBSD PF firewall for web server - /etc/pf.conf
# vim: set ft=pf
# /etc/pf.conf
ext_if="vtnet0"
webports = "{http, https}"
int_tcp_services = "{domain, ntp, smtp, www, https, ftp}"
int_udp_services = "{domain, ntp}"
set skip on lo
@jbinto
jbinto / howto-recover-google-authenticator-keys.txt
Created February 8, 2014 04:20
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
@shamil
shamil / mount_qcow2.md
Last active June 17, 2024 17:27
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@basham
basham / css-units-best-practices.md
Last active June 27, 2024 18:26
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@wmertens
wmertens / nix.YAML-tmLanguage
Last active October 6, 2022 19:42
Syntax highlighting for Nix in Sublime Text YAML-tmLanguage format
# [PackageDev] target_format: plist, ext: tmLanguage
# Made by Wout.Mertens@gmail.com
# This grammar tries to be complete, but regex-based highlighters
# can't be full parsers. Therefore it's a bit looser than the Nix
# parser itself and some legal constructs will be marked as illegal.
# It seems to work fine for nixpkgs.
# Cute hacks: Check out the attrset-for-sure and friends definitions
---
name: Nix
scopeName: source.nix
@rubo77
rubo77 / ln-conv-hl
Last active December 15, 2020 10:54
convert hard-links to symbolic links
#!/bin/bash
#
# converts hard-links to symbolic links
#
#-------------- Author: -------------#
# by Ruben Barkow
# git: https://gist.github.com/7a9a83695a28412abbcd.git
#--- Copyright and license -----------#
#This code is covered by the GNU General Public License 3.
@mdamien
mdamien / scrap.py
Created April 15, 2015 23:15
Google login images
import requests
from bs4 import BeautifulSoup
with open('urls','w') as f:
while True:
r = requests.get("https://login.corp.google.com/")
soup = BeautifulSoup(r.text)
src = soup.find("img","login-image")['src']
print(src)
f.write(src+"\n")
@sepehr
sepehr / pgp.md
Last active November 18, 2023 19:11
PGP Guide

PGP Guide

GPG vs PGP

PGP can refer to two things:

The Pretty Good Privacy software originally written by Phil Zimmermann, and now owned by Symantec. The formats for keys, encrypted messages and message signatures defined by that software. These have now been formalised as the OpenPGP standard. The GPG software is an independent implementation of the OpenPGP standards, so you can use it to exchange encrypted messages with people using other OpenPGP implementations (e.g. Symantec's PGP).