Skip to content

Instantly share code, notes, and snippets.

Avatar

tim kennedy tksunw

View GitHub Profile
@tksunw
tksunw / rename-homedir.ps1
Created December 1, 2021 20:59
rename-homedir
View rename-homedir.ps1
function Rename-HomeDir {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[String]$OldName,
[Parameter(Mandatory=$true)]
[String]$NewName
)
@tksunw
tksunw / prism.css
Last active September 6, 2021 18:26
View prism.css
/* PrismJS 1.24.1
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+bash+basic+c+csharp+cpp+diff+dns-zone-file+git+java+javastacktrace+json+json5+log+markup-templating+nginx+perl+php+powerquery+powershell+puppet+python+regex+ruby+rust+shell-session+sql+vim+visual-basic+xml-doc+yaml */
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/
code[class*="language-"],
pre[class*="language-"] {
@tksunw
tksunw / reclaimWindows10.ps1
Created November 17, 2016 19:42 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Originally forked from http://pastebin.com/gQxCUkLP, but the author is on github @ https://github.com/Disassembler0
View reclaimWindows10.ps1
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
View build_openvpn_solaris
# tar -zxvf openvpn-2.3.6.tar.gz
x openvpn-2.3.6, 0 bytes, 0 tape blocks
x openvpn-2.3.6/openvpn.sln, 2323 bytes, 5 tape blocks
x openvpn-2.3.6/msvc-env.bat, 1538 bytes, 4 tape blocks
x openvpn-2.3.6/config.h.in, 20812 bytes, 41 tape blocks
x openvpn-2.3.6/sample, 0 bytes, 0 tape blocks
x openvpn-2.3.6/sample/Makefile.am, 918 bytes, 2 tape blocks
x openvpn-2.3.6/sample/Makefile.in, 16744 bytes, 33 tape blocks
x openvpn-2.3.6/sample/sample-config-files, 0 bytes, 0 tape blocks
x openvpn-2.3.6/sample/sample-config-files/tls-office.conf, 1948 bytes, 4 tape blocks
@tksunw
tksunw / build_lzo_solaris
Last active August 29, 2015 14:18
Building the LZO Compression Library on Solaris 11.2
View build_lzo_solaris
# wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz
--2015-04-08 23:32:00-- http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz
Resolving www.oberhumer.com (www.oberhumer.com)... 193.170.194.40
Connecting to www.oberhumer.com (www.oberhumer.com)|193.170.194.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 594855 (581K) [application/x-gzip]
Saving to: ‘lzo-2.09.tar.gz’
lzo-2.09.tar.gz 100%[=====================>] 580.91K 665KB/s in 0.9s
@tksunw
tksunw / build_tap_solaris
Created April 9, 2015 03:19
Getting and Building the TAP Driver for Solaris
View build_tap_solaris
# git clone https://github.com/kaizawa/tuntap.git
Cloning into 'tuntap'...
remote: Counting objects: 134, done.
remote: Total 134 (delta 0), reused 0 (delta 0), pack-reused 134
Receiving objects: 100% (134/134), 88.35 KiB, done.
Resolving deltas: 100% (76/76), done.
# cd tuntap
# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
@tksunw
tksunw / gist:7470268
Last active December 28, 2015 08:18
bashhist.c.patch. originally for bash 4.1, this change updates the log entries sent to syslog to match the format of the BOFH hardened TCSH shell. consistent log formats makes it easier to detect anomolies. goes with the blog post at http://www.timkennedy.net/2010/12/logging-shell-commands-to-syslog-on.html
View gist:7470268
--- bashhist.c.orig 2010-12-07 04:16:12.692508765 -0500
+++ bashhist.c 2010-12-07 04:43:19.635794444 -0500
@@ -709,12 +709,12 @@
char trunc[SYSLOG_MAXLEN];
if (strlen(line) < SYSLOG_MAXLEN)
- syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s", getpid(), current_user.uid, line);
+ syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: [%s UID=%d] %s", current_user.user_name, current_user.uid, line);
else
{