Skip to content

Instantly share code, notes, and snippets.

Avatar

redbeard brianredbeard

View GitHub Profile
@eladtamary
eladtamary / tag_untagged_csi_volumes.sh
Last active Nov 2, 2021
This script is used tag AWS volumes that were created by Kubernetes CSI external provisioner. In each execution, the script will tag all AWS volumes that are un-tagged using the tags of the attached instance. This is a workaround until it will be implemented by the external-provisioner natively. See related issue: https://github.com/kubernetes-c…
View tag_untagged_csi_volumes.sh
#!/usr/bin/env bash
echo "$(date) - started to tag untagged CSI volumes"
untagged_csi_volumes=$(aws --profile my-aws-profile --output json ec2 describe-volumes \
--query 'Volumes[?!not_null(Tags[?Key == `Environment`].Value)] | []')
for volume in $(echo "${untagged_csi_volumes}" | jq -r '.[] | @base64'); do
volume_id=$(echo "$volume" | base64 --decode | jq -r '.VolumeId')
@jmau111
jmau111 / ePubToMobiKindle.md
Last active Jan 21, 2022
Install and set kindlegen on Linux to generate .mobi files for your Kindle
View ePubToMobiKindle.md

update 12/09/2021: Amazon does not provide KindleGen anymore 👿

1. Go here and download your archive (depending on your operating system) 2. extract the folder e.g at the root of your path "/"~ 3. open terminal and enter :

cd ~/kindlegen

then you can run :

@cyberwani
cyberwani / .htaccess
Created Aug 10, 2018
Block the HTTRACK using HTACCESS files
View .htaccess
Options All -Indexes
# Ultimate htaccess Blacklist 2 from Perishable Press
# Deny domain access to spammers and other scumbags
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ADSARobot|ah-ha|almaden|aktuelles|Anarchie|amzn_assoc|ASPSeek|ASSORT|ATHENS|Atomz|attach|attache|autoemailspider|BackWeb|Bandit|BatchFTP|bdfetch|big.brother|BlackWidow|bmclient|Boston\ Project|BravoBrian\ SpiderEngine\ MarcoPolo|Bot\ mailto:craftbot@yahoo.com|Buddy|Bullseye|bumblebee|capture|CherryPicker|ChinaClaw|CICC|clipping|Collector|Copier|Crescent|Crescent\ Internet\ ToolPak|Custo|cyberalert|DA$|Deweb|diagem|Digger|Digimarc|DIIbot|DISCo|DISCo\ Pump|DISCoFinder|Download\ Demon|Download\ Wonder|Downloader|Drip|DSurf15a|DTS.Agent|EasyDL|eCatch|ecollector|efp@gmx\.net|Email\ Extractor|EirGrabber|email|EmailCollector|EmailSiphon|EmailWolf|Express\ WebPictures|ExtractorPro|EyeNetIE|FavOrg|fastlwspider|Favorites\ Sweeper|Fetch|FEZhead|FileHound|FlashGet\ WebWasher|FlickBot|fluffy|FrontPage|GalaxyBot|Generic|Getleft|GetRight|
@ggsalas
ggsalas / kitty.conf
Last active May 12, 2022
Kitty terminal - one dark theme [~/.config/kitty/kitty.conf]
View kitty.conf
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
# font_family Monaco
font_family Source Code Pro
@lukasnellen
lukasnellen / 00-serial-console.md
Last active Jul 9, 2022
kvm serial console for virtual machine
View 00-serial-console.md

Serial console for KVM based VM and IPMI serial channel

grub and kernel console

Set in /etc/default/grub:

...
###GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8 console=tty1"
GRUB_CMDLINE_LINUX=""
@FergusInLondon
FergusInLondon / mpris.py
Last active Sep 21, 2020
Retrieve data from a Media Player in Linux, via dbus. (Uses Python)
View mpris.py
import dbus
class MediaPlayer:
"""Recieves state from a MediaPlayer using dbus."""
player_properties = False
def __init__(self, player_name):
# Get an instance of the dbus session bus, and retrieve
# a proxy object for accessing the MediaPlayer
@ianchen06
ianchen06 / end.gcode
Last active Feb 23, 2022
Anet A8 start end gcode
View end.gcode
;End GCode
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
M84 ;steppers off
@kylemanna
kylemanna / dnsmasq.sh
Created Mar 15, 2017
Simple tftp server using dnsmasq
View dnsmasq.sh
$ sudo dnsmasq -kd -p 0 -C /dev/null -u nobody --enable-tftp --tftp-root=/srv/ftp
@mario52a
mario52a / Macro_CloneConvert.FCMacro
Last active Sep 7, 2021
Creates a clone or copy of the object and the converted in the chosen position and size (inch, mm, m, µm...) or free. The base object is recognized in mm (FreeCAd base)
View Macro_CloneConvert.FCMacro
# -*- coding: utf-8 -*-
# CloneConvert.FCMacro
# Cree un clone ou une copie de l'objet ou des objets selectionne(s) et le met e l'echelle de la grandeur choisie
# utilisation : lancer CloneConvert selectionnez un objet choisissez la grandeur et cliquez sur OK
#
# Creates a clone of one copy the selected object and updates the selected size range
# use: start CloneConvert select an object choose the size and click OK
#
#OS: Windows 10 (10.0)
View a-gopher-rising.md

A Gopher Rising

Inspired by Maya Angelou's Still I Rise

You may walk through my GitHub history,
With it’s non idiomatic and fragal lines,
You may value me less than dirt,
But still, like dust, I’ll rise.