Skip to content

Instantly share code, notes, and snippets.

View bigpresh's full-sized avatar

David Precious bigpresh

View GitHub Profile
@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
---
[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]
@bigpresh
bigpresh / summarise-hostnames.pl
Created January 18, 2017 14:39
summarise-hostnames
sub summarise_hostnames {
my @hostnames = @_;
for my $entry (@hostnames) {
say "Consider $entry";
my ($leaf, $domain) = split /\./, $entry, 2;
if ($domain =~ /\./) {
say "OK, add $leaf to $domain list";
push @{ $leaf_by_domain{$domain} }, $leaf;
} else {
say "Treat $entry as a domain only";
@bigpresh
bigpresh / trigger.pl.diff
Created December 5, 2016 21:11
trigger.pl - adding -targettag option to allow commands to react from a different connection
--- /home/davidp/tmp/vimbackups/trigger.pl_20161205-210005 2008-05-21 22:52:48.000000000 +0100
+++ /home/davidp/.irssi/scripts/trigger.pl 2016-12-05 21:05:09.123258579 +0000
@@ -107,6 +107,7 @@
Other options:
-disabled: %|Same as removing it, but keeps it in case you might need it later
-name: %|Give the trigger a name. You can refer to the trigger with this name in add/del/change commands
+ -targettag: %|the tag of the server to react from
Examples:
Knockout people who do a !list: