This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o xtrace | |
set -o errexit | |
set -o pipefail | |
while true; do | |
pid=$(set +o pipefail; sudo fuser /var/lib/dpkg/lock-frontend 2>&1 | grep -o "[0-9]*" | head -n 1) | |
if [[ ! -z $pid ]]; then | |
sudo pstree -sa $pid | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Approve Closed GitHub PR | |
// @icon https://raw.githubusercontent.com/xthexder/wide-github/master/icons/icon.png | |
// @namespace https://gist.github.com/lucasrangit/792324f4695babc701cdd64e18a63f4b | |
// @version 1.2 | |
// @description A closed PR does not allow approval via the Web GUI. This adds the approval event back when submitting a retroactive review. | |
// @author Lucas Magasweran | |
// @match https://*.github.*/*/pull/* | |
// @grant none | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script creates multiple virtual interfaces | |
# all of these interfaces associate to the same AP to see how many associations the AP can handle | |
set -o errexit | |
set -o xtrace | |
DEVNAME=wlx0024a5219b70 | |
CLIENTS=50 | |
SSID=bhnt-vote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#utility http://moiseevigor.github.io/software/2015/01/30/get-file-creation-time-on-linux-with-ext4/ | |
xstat() { | |
#temporary file to be sorted | |
temp_file=$(mktemp) | |
for target in "${@}"; do | |
inode=$(ls -di "${target}" | cut -d ' ' -f 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
source /usr/lib/grub/grub-mkconfig_lib | |
cat << EOF | |
menuentry "Flash BIOS using DOS" { | |
search --no-floppy --hint '(hd0,msdos1)' --set --fs-uuid 865C-483D | |
chainloader +1 | |
} | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2011, RidgeRun | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright | |
* notice, this list of conditions and the following disclaimer in the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, urllib2 | |
import json | |
from secrets import device_id, access_token | |
url = 'https://api.particle.io/v1/devices/'+device_id+'/analogread' | |
values = { | |
'params' : 'A0', | |
'access_token' : access_token, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="http://flashair" | |
list () { | |
curl --silent "${URL}/command.cgi?op=100&DIR=${1}" \ | |
| awk 'BEGIN { FS=","; OFS="/" } /.+,.+,[^0,]/ { print $1,$2 }' | |
} | |
files () { | |
for dir in $@; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A generic CircularArray class that can be efficiently rotated and is | |
* iterable. | |
*/ | |
import java.util.Iterator; | |
public class CircularArray implements Iterable<Object> { | |
private Object[] a; | |
private int r; |