Skip to content

Instantly share code, notes, and snippets.

Avatar

redbeard brianredbeard

View GitHub Profile
@eladtamary
eladtamary / tag_untagged_csi_volumes.sh
Last active Mar 26, 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')
@lukasnellen
lukasnellen / 00-serial-console.md
Last active Oct 21, 2021
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 Oct 3, 2020
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.
@ethack
ethack / TypeClipboard.md
Last active Oct 25, 2021
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.
View TypeClipboard.md

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

View openshift-cheatsheet.md

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@nstarke
nstarke / release-android-debuggable.md
Last active Oct 3, 2021
How to make a Release Android App debuggable
View release-android-debuggable.md

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable