I hereby claim:
- I am aspotton on github.
- I am aspotton (https://keybase.io/aspotton) on keybase.
- I have a public key ASDrwiut23zglLbUsvMTmmcXGBzU4MiaN29fwGJI80yjOQo
To claim this, I am signing this object:
| <?php | |
| if (!isset($argv[1])) { | |
| print "You need to give the URL to lookup the category for: {$argv[0]} http://www.example.com\n"; | |
| exit(1); | |
| } | |
| $uri = trim($argv[1]); | |
| $request = "https://categories.webshrinker.com/preview/lookup/".strtr(base64_encode($uri), '+/', '-_'); |
| #!/usr/bin/perl | |
| # | |
| # syslog captures great imformation but the timestamps are very cryptic | |
| # This script is handy because it prints syslog messages with translated, human readable timestamps | |
| # Script originally from: https://linuxaria.com/article/how-to-make-dmesg-timestamp-human-readable | |
| # | |
| use strict; | |
| use warnings; |
| # Assumes that these are installed on the host system: | |
| # * nvidia binary drivers | |
| # * CUDA | |
| # * cuDNN | |
| docker run -it --rm $(ls /dev/nvidia* | xargs -I{} echo '--device={}') $(ls /usr/lib/*-linux-gnu/{libcuda,libnvidia}* | xargs -I{} echo '-v {}:{}:ro') -v $(pwd):/code test:test /bin/bash |
| #!/usr/bin/env python | |
| # Python screenshot tool (fullscreen/area selection) | |
| import sys | |
| import os | |
| from io import BytesIO | |
| from PyQt5 import QtCore, QtGui | |
| from PyQt5.QtGui import QPixmap, QScreen | |
| from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QSizePolicy, QGroupBox, QSpinBox, QCheckBox, QGridLayout, QPushButton, QHBoxLayout, QVBoxLayout, QFileDialog | |
| from subprocess import getoutput |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Boto v2 doesn't use the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable when running under Amazon ECS | |
| # as a task, making it fail to find the AWS security credentials. This will export the ENV variables that Boto expects | |
| # to find and is a suitable workaround. | |
| CREDS=`curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` | |
| export AWS_ACCESS_KEY_ID=`echo -n $CREDS | python2 -m json.tool | grep AccessKeyId | awk '{print $2}' | sed 's/[",]//g'` | |
| export AWS_SECRET_ACCESS_KEY=`echo -n $CREDS | python2 -m json.tool | grep SecretAccessKey | awk '{print $2}' | sed 's/[",]//g'` | |
| export AWS_SECURITY_TOKEN=`echo -n $CREDS | python2 -m json.tool | grep Token | awk '{print $2}' | sed 's/[",]//g'` |
| #!/bin/bash | |
| # Records only speaker output | |
| #/usr/bin/ffmpeg -f x11grab -y -r 15 -s 1920x1080 -i :1.0+1920,0 -f pulse -i default -vcodec mpeg4 -qscale 0 ~/video.mp4 | |
| # Records speaker output and webcam microphone input together (Pulse audio) | |
| # Find microphone: pacmd list-sources | |
| # Test recording: ffmpeg -f pulse -ac 2 -i alsa_input.usb-046d_0821_AE9295A0-00.analog-stereo test.mp4 | |
| /usr/bin/ffmpeg -f x11grab -y -r 15 -s 1920x1080 -i :1.0+1920,0 -f pulse -i alsa_output.usb-DisplayLink_Plugable_UD-ULTCDL_10027015-02.analog-stereo.monitor -f pulse -ac 2 -i alsa_input.usb-046d_0821_AE9295A0-00.analog-stereo -filter_complex "[1:0][2:0]amix=inputs=2:duration=shortest" -vcodec mpeg4 -qscale 0 ~/video.mp4 |
| #!/usr/bin/env python3 | |
| import os | |
| import sys | |
| BLOCK_SIZE = 4096 # 4 KB | |
| def is_zero_block(block): | |
| return block == b'\x00' * len(block) | |
| def sparse_copy(src_path, dst_path): |