Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@dialt0ne
dialt0ne / get_aws_dns_ip.sh
Created December 17, 2015 22:44
Get AmazonProvidedDNS IP address from the EC2 meta-data
MAC_ADDR=`curl -s http://169.254.169.254/latest/meta-data/mac`
CIDR_FULL=`curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC_ADDR}/vpc-ipv4-cidr-block`
CIDR_BASE=`echo ${CIDR_FULL} | cut -d/ -f1 | cut -d\. -f1-3`
LAST_OCTET=`echo ${CIDR_FULL} | cut -d/ -f1 | cut -d\. -f4`
DNS_OCTET=`expr ${LAST_OCTET} + 2`
DNS_IP="${CIDR_BASE}.${DNS_OCTET}"
echo $DNS_IP
@nl5887
nl5887 / gpg-agent.conf
Last active November 14, 2022 09:37
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@btm
btm / gist:6233398
Created August 14, 2013 17:35
Using grep against STDERR
# This error goes to STDERR
$ asdfasdf
-bash: asdfasdf: command not found
# We redirect STDERR to STDOUT, but STDOUT to null, so we can use grep against STDERR
$ asdfasdf 2>&1 >/dev/null | grep -q not ; echo $?
0
@waffle2k
waffle2k / cidr2regex.py
Created April 3, 2012 18:04
Convert CIDR notation to regex
#!/usr/bin/python
''' Not my script, found on the Internet, and rediscovered on my hard drive
'''
import sys
def cidr_to_regex(cidr):
ip, prefix = cidr.split('/')
base = 0
for val in map(int, ip.split('.')):
@huitseeker
huitseeker / mindeps.py
Created December 28, 2010 19:10
Minimizes a list of debian packages by removing those implied as dependencies of the others
#!/usr/bin/python
#######################################################################
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License as #
# published by the Free Software Foundation; either version 2 of the #
# License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
@z1nkum
z1nkum / graphite-grafana-statsd-inside-docker.md
Last active May 10, 2023 08:43
Run graphite-stack inside docker via docker-compose
# getenforce
Disabled

Also we need docker, docker-compose, certbot (if you need LetEncrypt)

mkdir -p /opt/graphite/conf /opt/graphite/data /opt/graphite/storage /opt/statsd /opt/grafana/log

/etc/docker/compose/graphite/docker-compose.yml

@agrif
agrif / rgba-glx.c
Created December 16, 2012 01:58
MacSlow's ARGB GLX visuals demo, archived here because the original site is down :(
/*******************************************************************************
**3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
** 10 20 30 40 50 60 70 80
**
** program:
** rgba-glx
**
** author:
** Mirco "MacSlow" Mueller <macslow@bangang.de>
**
@spudbean
spudbean / gist:1558257
Last active August 25, 2023 19:26
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons
@juliyvchirkov
juliyvchirkov / macos-sudo-nopasswd.sh
Last active August 28, 2023 15:43
bash: sudo without a password on macOS
#!/bin/bash
#
# Enable nopasswd mode for sudo on macOS from the userspace in fast and totally non-interactive way
#
# Type the password last time to apply the new mode and forget it for any console task for ages
# Use the rollback to restore password protection
#
# Developed and tested by https://juliyvchirkov.github.io/ under the MIT license on macOS Big Sur 11.2.0
#
# Get latest version at https://gist.github.com/juliyvchirkov/3ca76582ed6b6a8366c9e7d60644960d
@NoXPhasma
NoXPhasma / installation.md
Last active October 7, 2023 09:44
Install stable-diffusion-webui with ROCm support on Linux

Install stable-diffusion-webui with ROCm support on Arch Linux

First time installation:

  1. Clone and switch to the stable-diffusion-webui folder
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui
  1. Create a new python environment and switch to it