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 ruby | |
## | |
# Retrieve MFA credentials using the default profile and saving them to the mfa profile. | |
# Old credentials are removed in this process. | |
# | |
require 'json' | |
AWS_CREDS_FILE_PATH = File.join(ENV['HOME'], '.aws/credentials') |
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
# https://github.com/sorisum/valheim-server-docker | |
version: "3.9" | |
services: | |
valheim: | |
image: lloesche/valheim-server | |
volumes: | |
- /mnt/valheim:/config | |
- valheim_data:/opt/valheim | |
ports: | |
- "2456-2458:2456-2458/udp" |
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 | |
# | |
# A set of commands to run as pre-commit hooks for git. | |
# | |
# Save this to .git/hooks/pre-commit and make executable to enable | |
# | |
# This will run whenever we run `git commit`. | |
# To skip this, add `-n` or `--no-verify` flag. | |
# |
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 com.unboundid.ldap.sdk.LDAPConnection; | |
import com.unboundid.ldap.sdk.LDAPException; | |
import com.unboundid.ldap.sdk.LDAPSearchException; | |
import com.unboundid.ldap.sdk.SearchResult; | |
import com.unboundid.ldap.sdk.SearchResultEntry; | |
import com.unboundid.ldap.sdk.SearchRequest; | |
import com.unboundid.ldap.sdk.SearchScope; | |
import com.unboundid.ldap.sdk.controls.SimplePagedResultsControl; | |
import com.unboundid.util.ssl.SSLUtil; | |
import com.unboundid.util.ssl.TrustAllTrustManager; |
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 | |
## | |
# Filter a command like rubocop to look for issues only on modified lines. | |
# | |
# Inspired by http://takemikami.com/2018/01/30/RubocopPullRequestCI.html | |
# | |
BASE_REMOTE=origin | |
BASE_BRANCH=master |
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
// https://www.thingiverse.com/developers/rest-api-reference | |
/******************************************************************************* | |
* The headers needed for authenticating with the API. | |
* Get the SECRET_TOKEN using the browser tools of Firefox or Chrome: | |
* 1. Open the browser tools with F12 or ctrl+shift+i | |
* 2. Navigate to the Network tab | |
* 3. Reload a Thingiverse page | |
* 4. Locate a and select a request to api.thingiverse.com | |
* 5. Find the request headers and copy the token next to Authorization: Bearer |
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
## | |
# This can reproduce https://github.com/activeldap/activeldap/issues/186 | |
# | |
# Uses OpenLDAP Docker container | |
# docker run -p 1389:389 --name activeldap-test --detach osixia/openldap | |
# | |
require 'active_ldap' | |
class User < ActiveLdap::Base |
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 demonstration of the DN and base issue detailed in | |
# https://github.com/activeldap/activeldap/issues/185 | |
# Due to how requires are handled, we need to do some directory | |
# trickery to require our local copy of the source code. | |
base_dir = File.expand_path(File.dirname(__FILE__)) | |
top_dir = File.expand_path(File.join(base_dir, "..")) | |
lib_dir = File.join(top_dir, "lib") | |
$LOAD_PATH.unshift(File.join __dir__, 'lib') |
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
# The total number of threads we want to all to run at the same time | |
concurrent_thread_limit = 4 | |
# The total number of threads to run for this demo | |
total_thread_count = 13 | |
@threads = [] | |
## | |
# Print the status of all threads to the console | |
# |
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 sys | |
import time | |
# https://pypi.org/project/evdev/ | |
import evdev | |
string = 'We are typing this 1!' | |
with evdev.UInput() as ui: | |
escape = False |