Skip to content

Instantly share code, notes, and snippets.

View kfowlks's full-sized avatar

Kevin Fowlks kfowlks

  • me myself and I
  • slams.tiny.scare
View GitHub Profile
@rjeschke
rjeschke / NeetJavaSound.java
Created September 11, 2011 19:26
Low latency javax.sound.sampled API
package streaming;
import java.util.concurrent.Semaphore;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.Line;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;
@juliojsb
juliojsb / Jboss configuration file
Created March 23, 2016 22:19
Enable remote debugging in Jboss
For Jboss 4,5,6 AS and 6.x EAP standalone mode, append to your JAVA_OPTS the following option:
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
For Jboss 7.x AS/EAP 6.x in domain mode, in host.xml add the corresponding jvm option in the server group you need to debug:
<server name="server-one" group="main-server-group">
<!-- Remote JPDA debugging for a specific server
<jvm name="default">
<jvm-options>
@bockor
bockor / gist:ff2aef9f5be1ea98ac6fb927bb460d7d
Last active February 22, 2021 02:40
gunicorn-as-a-systemd-service with python3 and bottle framework
Gunicorn, or Green Unicorn, is a UNIX-compatible WSGI HTTP server that is commonly used to run Python applications.
Developed in 2010 by Benoit Chesneau, this open source project is similar to uWSGI, mod_wsgi, and CherryPy.
Gunicorn is often implemented with a reverse proxy server like NGINX, which typically handles requests for static resources and then passes on the requests to Gunicorn.
Gunicorn processes the dynamic portion of the request and returns a response to NGINX, which sends the response back to the client.
Gunicorn can be used to serve Python applications and is compatible with frameworks like Django, Flask and Bottle.
It’s easy to configure, lightweight, and only needs 4–12 worker processes to handle hundreds or thousands of requests per second.
# create python3 virtual environment
# ==================================
@nogweii
nogweii / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
@gdamjan
gdamjan / qemu-arm.conf
Last active July 13, 2022 04:45
binfmt conf file to run arm elf files on x86 (with qemu-user-static installed)
# /etc/binfmt.d/qemu-arm.conf
:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:
@stephenhouser
stephenhouser / Python-word-counter
Last active August 18, 2022 01:47
Python Word Frequency Analyzer
Simple Python Word Frequency Analyzer
@mydoghasworms
mydoghasworms / json_util.abap
Last active February 19, 2023 14:46
ABAP Utility class for mapping JSON to ABAP data and vice versa - Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
* Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
* The alternative is a better parser although it is not an emmitter)
*----------------------------------------------------------------------*
* CLASS json_util DEFINITION
*----------------------------------------------------------------------*
class json_util definition.
public section.
class-methods:
data_to_json importing data type any
returning value(json) type string,
@jhamman
jhamman / LICENSE
Created January 26, 2023 21:37 — forked from nymous/README.md
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)
MIT License
Copyright (c) 2023 Thomas GAUDIN
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@maxkagamine
maxkagamine / backup_flash_and_appdata.sh
Last active June 28, 2023 01:34
Unraid user script to create backups of the flash drive and appdata on a schedule. An email is sent with the full command output if the cronjob fails.
#!/bin/bash
#name=Backup flash and appdata
#description=Creates tarballs of the flash drive and appdata share.
#argumentDescription=Backup directory
#argumentDefault=/mnt/user/Backup/Sovngarde
#arrayStarted=true
#noParity=true
#clearLog=true
set -eo pipefail
shopt -s extglob
@adamgreig
adamgreig / icalcombine.py
Created October 22, 2014 14:13
Read multiple iCal / ICS files from URLs, then produce a merged output with all repeating events and all events that will end today or later.
#!/usr/bin/env python
"""
iCal Combine
./icalcombine.py <input URLs file> <output filename>
Read ICS (iCAL) URLs, one per line, from the <input URLs files>, then combine
into a single iCal which is written to <output filename>.
"""
import sys