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 | |
# As described in https://bugs.launchpad.net/bugs/1766076 | |
### Installation Instructions: | |
# 1. Install file into `/usr/local/bin/reset-tb` | |
# | |
# 2. Optional: allow password less sudo by creating a file `/etc/sudoers.d/allow-reset-tb` with the following content: | |
# ----8<----- | |
# <your username> ALL = NOPASSWD: /usr/local/bin/reset-tb | |
# ----8<----- | |
# |
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 | |
# | |
# Installation: | |
# 1. put this script somewhere in your path - `/usr/local/bin/powerdraw` is probably | |
# a good idea. | |
# 2. Give the script execution permissions, e.g. `sudo chmod a+x /usr/local/bin/powerdraw` | |
# 3. Optional - add a sudoers file to allow users to execute this file without typing their | |
# password over and over. For example, create `/etc/sudoers.d/allow-powerdraw` with the | |
# following content: | |
# %admin ALL = NOPASSWD: /usr/local/bin/powerdraw, /usr/local/bin/powerdraw -f |
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 | |
verbosity=info | |
tokfile="/tmp/tok-$$" | |
domlist_pfx="/tmp/doms-$$-" | |
doctl_tokens=( | |
# Place all your DO personal access tokens here in this array as simple text, preferably one per line | |
) | |
function log() { |
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
deb http://archive.ubuntu.com/ubuntu lunar main restricted | |
deb-src http://il.archive.ubuntu.com/ubuntu/ lunar main restricted | |
deb http://archive.ubuntu.com/ubuntu lunar-updates main restricted | |
deb-src http://il.archive.ubuntu.com/ubuntu/ lunar-updates main restricted | |
deb http://archive.ubuntu.com/ubuntu lunar universe | |
deb-src http://il.archive.ubuntu.com/ubuntu/ lunar universe | |
deb http://archive.ubuntu.com/ubuntu lunar-updates universe |
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 | |
function usage() { | |
( | |
echo "usage: $0 <auth-token> <group-address> <mbox-dir>" | |
echo "To generate an auth token go to https://developers.google.com/oauthplayground/ and get an access token for Google Groups migration" | |
) >&2 | |
exit 5 | |
} |
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
package coil.geek; | |
import java.util.concurrent.atomic.AtomicLong; | |
/** | |
* A token-based rate limiter, inspired by https://stackoverflow.com/a/55349487/53538 | |
* | |
* The original implementation boasts an O(1) time complexity as well as O(1) space complexity, but controls | |
* concurrency using synchronization. This implementation uses atomic operations to offer lock-less concurrency | |
* and reentrancy. |
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 | |
## | |
# Helper to find the user configured name of an activity, by its ID | |
function getActivityName() { | |
qdbus org.kde.ActivityManager /ActivityManager/Activities \ | |
org.kde.ActivityManager.Activities.ActivityName "$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
#!/usr/bin/python | |
"""A little script to recover deleted recording of a mongoDB db file | |
There's no optimization but it work and has saved me | |
""" | |
import struct | |
import bson | |
import pymongo |
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
package testing; | |
import io.vertx.core.Future; | |
import io.vertx.core.Promise; | |
import io.vertx.core.Vertx; | |
public class VertxFutureTest { | |
static Object waiter = new Object(); | |
static boolean done = false; |
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
## | |
# | |
# Custom resource setup to provide an identity function that can be used to | |
# implement "custom variables". | |
# See: https://serverfault.com/a/812040/6438 | |
# | |
# Usage: | |
# | |
# After deploying the below code to your stack, you can define computed | |
# variables thus: |
NewerOlder