Skip to content

Instantly share code, notes, and snippets.

@bricef
bricef / lookup-nobatteries.py
Created June 9, 2011 19:01
Python script to carry out a reverse hostname lookup. Version 1: The dummy way.
#!/usr/bin/env python
import sys, re, os, popen2
hosts_locs = [
"/etc/hosts",
"C:/Windows/system32/drivers/etc/hosts"
]
hosts = {}
@carlj
carlj / rsa-encryption.md
Last active February 28, 2020 07:01
RSA large File En- and Decryption

RSA File De- and Encryption

Docu for encrypt and decrypt a large file with AES and RSA

Keypairs

Generate RSA Keypairs

//generates a private Key with 8196 Bit. 
openssl genrsa -out private.pem 8196
@josephspurrier
josephspurrier / drop_encrypt.go
Last active March 24, 2020 17:48
Golang - Drag and Drop AES Encryption and Decryption
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
@dirtycajunrice
dirtycajunrice / plex.conf
Last active July 14, 2022 14:35
Plex-Apache-Reverse-Proxy
# requires a2enmod proxy proxy_http proxy_wstunnel rewrite ssl
<VirtualHost *:80>
ServerName plex.domain.tld
ServerAlias plex.domain2.tld
Redirect / https://plex.domain.tld
</VirtualHost>
<VirtualHost *:443>
a. –XX:+UseParNewGC – Use parallel GC in the young generation
b. –XX:–UseParNewGC – Use serial GC in young generation
c. –XX:+UseParallelGC - Use parallel GC in the young generation, serial in old generation
d. –XX:+UseSerialGC – Use serial generational GC
e. –XX:+UseParallelOldGC – Use parallel GC in both young and old generation.
f. –XX:+UseConcMarkSweepGC – Use Concurrent Mark Sweep GC in old generation.
g. –XX:+AlwaysTenure – Always create objects in old generation.
h. –XX:+UseG1GC – Use G1 garbage collector
i. –XX:PretenureSizeThreshold=<n bytes> - Allocate objects greater than n bytes in size directly in old generation
j. –Xms=<nM/m/g/G> – This option lets you specify minimum memory that is allocated to your Java heap.
@jvhaarst
jvhaarst / movedigiphotos.bash
Last active December 12, 2022 22:02
Bash script to move images, based on exif data and file timestamp
#!/bin/bash
# Reads EXIF creation date from all .JPG files in the
# current directory and moves them carefully under
#
# $BASEDIR/YYYY/YYYY-MM/YYYY-MM-DD/
#
# ...where 'carefully' means that it does not overwrite
# differing files if they already exist and will not delete
# the original file if copying fails for some reason.
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@domwrap
domwrap / Google Music All Access Family Plan for G-Suite GMail Vanity Domains.md
Last active August 24, 2023 02:26
Google Music All Access Family Plan for G-Suite / GMail Vanity Domains

Google Music All Access Family Plan for G-Suite / GMail Vanity Domains

Synopsis

I had wondered about this some weeks ago before finally trying it out today. I'm surprised nobody else had tried already. I was successful enough to be satisfied for my own uses. YMMV.

Result is I have a new Play Music account with Family Sharing which I can share with my G-Suite users, with all my playlists* moved over, and without anyone needing to maintain a separate email account.

This whole process took me about an hour, including moving across 15 playlists, but not including MX record propagation.

@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@jansanchez
jansanchez / gist:ce5b0ca1c5e538f4b266
Last active February 28, 2024 00:27
How to install NVIDIA video drivers in Elementary OS