Skip to content

Instantly share code, notes, and snippets.

@aplocher
aplocher / AnyConnect.ahk
Last active September 6, 2023 07:18
AutoHotKey script for Cisco AnyConnect. Takes hostname, username, and password as external args. Great for creating multiple shortcuts if you have more than one AnyConnect VPN.
; Create a shortcut to this file in Windows for each AnyConnect VPN configuration you need
; Each shortcut can have a different host, user, and pass defined (3 command line args)
; Usage: AutoHotKey.exe AnyConnect.ahk hostname username password
#SingleInstance force
if 0 < 3 ; The left side of a non-expression if-statement is always the name of a variable.
{
MsgBox This script requires at least 3 incoming parameters but it only received %0%.
ExitApp
}
@iamkristian
iamkristian / log4jAdmin.jsp
Last active May 3, 2023 05:04
Change log4j log levels runtime from a jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.log4j.Level" %>
<%@ page import="org.apache.log4j.LogManager" %>
<%@ page import="org.apache.log4j.Logger" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Set" %>
<%@ page import="java.util.Arrays" %>
<%
/* This was originally suggested by Nelz on http://nelz.net/2008/04/08/log4j-runtime-configuration