Skip to content

Instantly share code, notes, and snippets.

View SimonLammer's full-sized avatar

Simon Lammer SimonLammer

View GitHub Profile
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@wrzlbrmft
wrzlbrmft / xfce-hide-hibernate-suspend-etc.txt
Last active June 28, 2023 12:17
Hide Hibernate, Suspend, etc. option from the XFCE shutdown dialog.
# as normal user
xfconf-query -c xfce4-session -np '/shutdown/ShowHibernate' -t 'bool' -s 'false'
xfconf-query -c xfce4-session -np '/shutdown/ShowSuspend' -t 'bool' -s 'false'
xfconf-query -c xfce4-session -np '/shutdown/ShowHybridSleep' -t 'bool' -s 'false'
xfconf-query -c xfce4-session -np '/shutdown/ShowSwitchUser' -t 'bool' -s 'false'
@prokls
prokls / pysha2 sha2 sha256.py
Last active July 8, 2023 21:29
Pure python3 implementation of SHA256 based on @thomdixon's pysha2
#!/usr/bin/python3
__base__ = 'https://github.com/thomdixon/pysha2/blob/master/sha2/sha256.py'
__author__ = 'Lukas Prokop'
__license__ = 'MIT'
import copy
import struct
import binascii
@ethack
ethack / TypeClipboard.md
Last active July 10, 2024 11:57
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

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.

@NeoTheThird
NeoTheThird / godot.desktop
Created February 11, 2017 20:52
A .desktop file for the godot engine. Icon has to point to a logo file.
[Desktop Entry]
Name=Godot Engine
Comment=An open source game engine. Need i say more?
Exec=/bin/godot
Icon=.godot.jpeg
Terminal=false
Type=Application
StartupNotify=true
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@suuuehgi
suuuehgi / 001evaluation.svg
Created February 4, 2018 15:58 — forked from Artefact2/00considerations.md
Borg compression benchmark/comparison
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SimonLammer
SimonLammer / regex-tester.py
Last active November 10, 2021 10:53
Can test a regular expression against a testsuite.
#!/usr/bin/python3
"""
Usage: regex-test.py <tests.json> <regex_file1> [<regex_file2> [...]]
The <tests.json> file should have the following format:
{
"usage": "To be used with https://gist.github.com/SimonLammer/6f7ddb1c87f61a65f046c2d7445eed34",
"group1name": {
"true": [
@diegoquintanav
diegoquintanav / ABOUT.md
Last active April 5, 2022 09:16
docker-compose for graph-tool
@viliampucik
viliampucik / pythonstartup.py
Created January 11, 2021 22:02
XDG compliant ~/.python_history
# Store interactive Python shell history in ~/.cache/python_history
# instead of ~/.python_history.
#
# Create the following .config/pythonstartup.py file
# and export its path using PYTHONSTARTUP environment variable:
#
# export PYTHONSTARTUP="${XDG_CONFIG_HOME:-$HOME/.config}/pythonstartup.py"
import atexit
import os