Skip to content

Instantly share code, notes, and snippets.

View NF1198's full-sized avatar

Nicholas Folse NF1198

  • Albuquerque, NM
View GitHub Profile
@NF1198
NF1198 / epkowa.conf
Created June 13, 2016 23:57
Epson L210 scanner config linux (epkowa.conf / dll.conf)
#Make the following updates to sane configration to enable Epson 210 scanner to function properly
# Add user to "lp" group then logout-login
#epkowa.conf
line: 10
-scsi
+#scsi
line: 26
@NF1198
NF1198 / debug-util.js
Last active October 14, 2016 20:31
node.js line number debug utility script - returns call site info for debugging purposes - compatible with TypeScript & ES5+
/*
* Copyright (c) 2016 Nicholas Folse -- All Rights Reserved
*
* debug-util.js -- Call site info for debugging javascript
*
* requires node 'source-map' (npm install source-map)
*
* usage:
*
* const debug_line = require("../debug-util");
@NF1198
NF1198 / bashrc.sh
Created February 24, 2017 21:59
genpasswd
# add to bashrc
#genpasswd <num_chars>
# generates a password of the specified length
genpasswd() {
local l=$1
[ "$l" == "" ] && l=20
tr -dc [:alnum:]\*\&\^\%\$\#\@\_ < /dev/urandom | head -c ${l} | xargs
}
#!/usr/bin/env sh
# A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params.
# from: https://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip/
# author: Nathan Broadbent
#
# usage:
# -$ cd ~
# -$ wget <raw file link>
# then add to .bashrc:
@NF1198
NF1198 / Samsung 900X4D-A58 Gamma Calibration - ICC.cal
Created October 12, 2017 01:01
Display calibration profile for Samsung 900X4D-A58 laptop
CAL
DESCRIPTOR "Argyll Device Calibration State"
ORIGINATOR "vcgt"
CREATED "Tue Oct 10 19:21:51 2017"
KEYWORD "DEVICE_CLASS"
DEVICE_CLASS "DISPLAY"
KEYWORD "COLOR_REP"
COLOR_REP "RGB"
@NF1198
NF1198 / Xsetup
Last active October 27, 2017 21:12
Set DPI in Linux VM before login screen starts
# find / -name Xsetup 2>/dev/null
# -or-
# find / -name Default 2>/dev/null (e.g. /etc/gdm3/Init/Default) -- doesn't work in gdm3 ...
# vim <path to file>/Xsetup
# verify with $ xdpyinfo | grep -B 2 resolution
# add line:
# xrandr --dpi <dpi>
@NF1198
NF1198 / StAXObjectBuilder.java
Last active May 11, 2020 14:41
An object builder for StAX
/*
* Copyright 2017 Nicholas Folse <https://github.com/NF1198>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@NF1198
NF1198 / CSVObjectReader.java
Last active March 18, 2018 04:12
A utility class that makes it easy to build objects from rows in a CSV file
/*
* Copyright 2017 tauTerra, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@NF1198
NF1198 / SingleTreadedSQLiteManager.java
Created July 18, 2018 23:30
SQLiteSingleThreadedManager
/*
* Copyright (c) 2018, tauTerra, LLC; Nicholas Folse
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
@NF1198
NF1198 / gist:985175e80f1ec0ae089d3cccb3824591
Last active August 23, 2018 20:47
git daemon server on-liner - current directory
git-serve() {
echo git daemon: $PWD && git daemon --verbose --export-all --reuseaddr --port=9090 --base-path=$PWD $PWD
}