Skip to content

Instantly share code, notes, and snippets.

View henhell's full-sized avatar
💻

Henrik Hellerstedt henhell

💻
  • Uppsala, Sweden
View GitHub Profile
@henhell
henhell / getopts-example.sh
Created September 9, 2020 06:45
bash built in getopts example
#!/bin/bash
opt_b=0
opt_c=0
scriptName=`basename $0`
showUsage() { echo "Usage: $scriptName -a <3333|7777> [-b] [-c]" 1>&2; exit 1; }
while getopts ":a:bc" opt; do
case "${opt}" in
a)
@henhell
henhell / scanner.sh
Created July 2, 2020 11:21 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@henhell
henhell / gist:2eb6fee1b2ba71fb18dd8e977d07cb59
Created August 27, 2018 08:35
Update bios from Linux on HP Elitebook 840 G3
!!! WARNING Selecting wrong /dev/sdX might wipe your main harddrive !!!
!!! These are only notes, not a step by step !!!
Download BIOS from HP's page, find your correct bios files via serialnumber
# sudo dmidecode |grep -A 4 "HP EliteBook"
Download the service pack spXXXXX.exe
# apt-get install wine-stable
# wine spXXXXX.exe
@henhell
henhell / slack_delete.py
Created March 22, 2018 07:38 — forked from Paradoxis/slack_delete.py
Delete all Slack files. Usage: python slack_delete.py --token <your token>
import argparse
import requests
import time
import json
def main():
"""
Entry point of the application
:return: void

Keybase proof

I hereby claim:

  • I am henhell on github.
  • I am henrikh (https://keybase.io/henrikh) on keybase.
  • I have a public key whose fingerprint is 73D7 571D 8F6C 6A1E 7F0F A17C 2DE0 29CC 17F8 6E2B

To claim this, I am signing this object: