Skip to content

Instantly share code, notes, and snippets.

View TheRealAgentK's full-sized avatar

Kai Koenig TheRealAgentK

View GitHub Profile
@TheRealAgentK
TheRealAgentK / .gitconfig
Created October 24, 2021 01:23 — forked from donnfelker/.gitconfig
Git and Fish
[user]
name = Your Name
email = you@youremail.com
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
@TheRealAgentK
TheRealAgentK / blkleaderboard.sh
Created October 12, 2020 07:07 — forked from grifferz/blkleaderboard.sh
Block device leaderboard
#!/bin/bash
# Paste at shell prompt (or download and execute) and get:
#
# sdc 9936 hours ( 1.13 years) 3.49TiB SAMSUNG MZ7KH3T8
# nvme0n1 9936 hours ( 1.13 years) 3.49TiB SAMSUNG MZQLB3T8HALS-00007
# sde 9932 hours ( 1.13 years) 4.55TiB ST5000LM000-2AN1
# sdd 9931 hours ( 1.13 years) 4.55TiB ST5000LM000-2AN1
# sdb 9617 hours ( 1.09 years) 0.01TiB SuperMicro SSD
# sda 9616 hours ( 1.09 years) 0.01TiB SuperMicro SSD
@TheRealAgentK
TheRealAgentK / version.sh
Created January 1, 2019 19:41
Bash script to output important Linux versions
#!/bin/sh
echo "\nOperating system:\n"
lsb_release -i
lsb_release -d
lsb_release -r
lsb_release -c
echo "\nLinux kernel:\n"
uname -r
@TheRealAgentK
TheRealAgentK / gist:c982ee491a1f03e8114af23bb97e1b6a
Created December 27, 2018 02:40
setupLogitechMouseButtons.sh
SEARCH="Logitech.*pointer"
ids=$(xinput --list | awk -v search="$SEARCH"\
'$0 ~ search {match($0, /id=[0-9]+/);\
if (RSTART)\
print substr($0, RSTART+3, RLENGTH-3)\
}'\
)
for i in $ids
kai@kai-tuxedo:~/development/mouse-udev-rules$ xinput -list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=16 [slave pointer (2)]
⎜ ↳ Logitech USB Receiver id=19 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
kai@kai-tuxedo:~$ xinput -list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ 2.4G Mouse id=10 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
@TheRealAgentK
TheRealAgentK / gist:6963387e93dc12e087e82a157aabe7c1
Last active March 20, 2018 22:54
Grabbing the Mercurial build number in Gradle
def getVersionBuild = { ->
try {
def stdout = new ByteArrayOutputStream()
def props = new Properties()
String osName = System.getProperty('os.name').toLowerCase();
props.load(new FileInputStream("user.properties"))
def hgBinary = props.getProperty("user.hgBinary")
@TheRealAgentK
TheRealAgentK / view_constructors.java
Last active January 29, 2018 19:49
View constructors
public KaisView(Context context) {
super(context);
init(...);
}
public KaisView(Context context, AttributeSet attrs) {
super(context,attrs);
init(...);
}
<cffunction name="fileToQuery" access="public" returntype="query">
<cfargument name="filePath" type="string" required="yes" />
<cfargument name="delimiter" type="string" required="yes" />
<cfargument name="columnList" type="string" required="no" default="" />
<cfargument name="skipLines" type="numeric" required="no" default="0" />
<cfargument name="trimSpaces" type="boolean" required="no" default="true" />
<cfset var fileReader = CreateObject("java", "java.io.FileReader").init(arguments.filePath) />
<cfset var buffReader = CreateObject("java", "java.io.BufferedReader").init(fileReader) />
<cfset var qFileData="" />

ColdFusion is a rapid development platform for building modern web applications. ColdFusion is designed to be expressive and powerful. The expressive characteristic allows you to perform programming tasks at a higher level than most other languages. The powerful characteristic gives you integration with functionality important to web applications like database access, MS Exchange access, PDF form creation and more.

The ColdFusion platform is built on Java and uses the Apache Tomcat J2EE container. While you have full access to Java and Tomcat, you need not worry about these details. You'll interact with ColdFusion and the user friendly ColdFusion Mark-up Language (CFML) to write your programs. Your ColdFusion files will use the file extension '.cfc' for objects and '.cfm' for pages. CFML requires much less ceremony and infrastructure than typical java while offering a significantly faster development experience than Java.

After taking this CF in a Week series, you'll have the basics n