Skip to content

Instantly share code, notes, and snippets.

View bigpresh's full-sized avatar

David Precious bigpresh

View GitHub Profile
@bigpresh
bigpresh / countries.json
Created December 11, 2013 13:24
A list of all countries and all states within them, generated by a Perl script using Locale::SubCountry (also included in this gist). May be helpful for people building web apps which want to provide dropdowns of countries and states/counties.
{
"AD" : {
"name" : "Andorra",
"states" : {
"02" : "Canillo",
"03" : "Encamp",
"04" : "La Massana",
"05" : "Ordino",
"06" : "Sant Julià de Lòria",
"07" : "Andorra la Vella",
@bigpresh
bigpresh / d2_session_stress_test.pl
Last active February 27, 2021 04:02
Dancer2 session stress testing
#!/usr/bin/env perl
use 5.012;
use LWP::UserAgent;
use Test::More qw(no_plan);
my $ua = LWP::UserAgent->new( cookie_jar => {} );
@bigpresh
bigpresh / chartjs-plugin-zoom.markdown
Created January 26, 2021 17:59
chartjs-plugin-zoom
@EventHandler
public void checkVehicleDismount(VehicleExitEvent e) {
// If this was an auto-minecart, destroy it
Vehicle vehicle = e.getVehicle();
if (vehicle.hasMetadata("autominecart")) {
vehicle.remove();
debugmsg("Destroyed an auto-minecart");
}
}
@bigpresh
bigpresh / gen-client-tarball.sh
Created September 17, 2019 09:50
gen-client-tarball.sh
[davidp@supernova:~/openvpn-easy-rsa]$ cat gen-client-tarball
#!/bin/bash
# Call with a client name, it will create a tarball named after that client
# containing keys/$CLIENT.{key,crt} and keys/ca.crt ready to provide
CLIENT=$1
TARBALL=$CLIENT-openvpn-keys.tar.gz
if [[ ! -f keys/$CLIENT.key ]]; then
@bigpresh
bigpresh / gist:e40cf97114f1acc158b8073a7a171b1e
Created August 10, 2019 16:48
VoteRoulette enable error- Java NoSuchMethodError
[14:24:05] [Server thread/ERROR]: Error occurred while enabling VoteRoulette v3.2.3 (Is it up to date?)
java.lang.NoSuchMethodError: org.bukkit.Bukkit.getServerName()Ljava/lang/String;
at com.mythicacraft.voteroulette.VoteRoulette.loadMessagesData(VoteRoulette.java:729) ~[?:?]
at com.mythicacraft.voteroulette.VoteRoulette.loadAllFilesAndData(VoteRoulette.java:414) ~[?:?]
at com.mythicacraft.voteroulette.VoteRoulette.onEnable(VoteRoulette.java:251) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.14.4.jar:git-Paper-163]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:338) ~[patched_1.14.4.jar:git-Paper-163]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:420) ~[patched_1.14.4.jar:git-Paper-163]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin(CraftServer.java:467) ~[patched_1.14.4.jar:git-Paper-163]
at org.bukkit.craftbukkit.v1_14_R1.Craf
@bigpresh
bigpresh / gist:debc24b3d8251a3e7095e6f60472faed
Created July 19, 2018 09:48
SSL connection failure to ZNC 1.7.1
[davidp@supernova:~]$ openssl s_client -connect myhostname:myport
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 289 bytes
---
@bigpresh
bigpresh / abitcrap.pl
Created October 12, 2011 12:38
Pick holes in.
#!/usr/bin/perl
my $filename = @ARGV[0];
open(FILE, $filename);
my @lines = <FILE>:
for (@lines) {
print if /foo/;
[davidp@shakermaker:~]$ sudo netstat -lnp | grep 5011
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
tcp 129 0 0.0.0.0:5011 0.0.0.0:* LISTEN 3862/starman worker
[davidp@shakermaker:~]$ sudo lsof | grep :5011
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
starman 3862 dancer 5u IPv4 5893569 0t0 TCP *:5011 (LISTEN)
starman 3862 dancer 8u IPv4 8140850 0t0 TCP localhost:5011->localhost:44802 (CLOSE_WAIT)
starman 4870 dancer 5u IPv4 5893569 0t0 TCP *:5011 (LISTEN)
starman 5663 dancer 5u IPv4 5893569 0t0 TCP *:5011 (LISTEN)
....
msgcache.c:586 Condition cache_file != NULL failed
traceback:
0: claws-mail(msgcache_read_cache+0xdde) [0x4e08ce]
1: claws-mail() [0x48be7b]
2: claws-mail(folder_item_get_msg_list+0x78) [0x48c6e8]
3: claws-mail() [0x495460]
4: claws-mail() [0x495ac7]
5: claws-mail(gtk_sctree_insert_gnode+0x10a) [0x61194a]
6: claws-mail(gtk_sctree_insert_gnode+0x1a9) [0x6119e9]