Skip to content

Instantly share code, notes, and snippets.

View kyxap1's full-sized avatar

Oleksandr Kukhar kyxap1

View GitHub Profile
@kyxap1
kyxap1 / .bash_logout
Last active April 30, 2021 21:57
Brume (GL-MV1000) Edge Computing Gateway
# sync history
history -a
history -w
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
@kyxap1
kyxap1 / nssm.jenkins.txt
Created February 24, 2021 15:29
Jenkins agent as windows service with Non-Sucking Service Manager (NSSM)
nssm install Jenkins "%COMMONPROGRAMFILES(x86)%\Oracle\Java\javapath\java.exe"
nssm set Jenkins AppParameters -jar agent.jar -jnlpUrl https://<jenksins-server-url>/computer/<jenkins-worker-node>/slave-agent.jnlp -secret <worker-secret> -workDir "C:\jenkins\"
nssm set Jenkins AppDirectory C:\Jenkins
nssm set Jenkins AppStdout C:\Jenkins\jenkins.log
nssm set Jenkins AppStderr C:\Jenkins\jenkins.log
nssm set Jenkins AppStopMethodSkip 6
nssm set Jenkins AppStopMethodConsole 1000
nssm set Jenkins AppThrottle 5000
nssm start Jenkins
@atheiman
atheiman / SSM-Automation-StartStopInstances.yml
Last active June 27, 2024 01:15
SSM Automation Document ("Runbook") to start instances, run a Command Document, then stop instances that were started
# Update this automation document:
# aws ssm update-document \
# --name "StartStopInstances" \
# --document-format YAML \
# --content "file://./StartStopInstances-Automation.yml" \
# --document-version '$LATEST'
# Execute this automation using IAM Service Role (https://gist.github.com/atheiman/021f1852997d0c42cd581d86aafc672f):
# aws ssm start-automation-execution \
# --region us-gov-west-1 \
@kyxap1
kyxap1 / !vpnc-script.sh
Last active February 22, 2021 19:13
Asus RT-N56U custom vpn client script
#!/bin/sh
ACTION=${1}
DEBUG=1
func_res() {
[[ ${DEBUG:-0} -ge 1 ]] && set 2>&1 | logger -t vpnc-script
# how to get cidrs: http://kyxap.org.ua/articles/google_ip_range
CIDRS="$(cat /opt/home/admin/cidrs/*.txt)"
EXCLUDE="$(cat /opt/home/admin/cidrs/exclude/*.txt)"
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: st1
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: kubernetes.io/aws-ebs
parameters:
type: st1
fsType: ext4
@kyxap1
kyxap1 / net.pro-manage.hatch.ssh-tunnel.plist
Created June 12, 2018 05:56
autossh autostart in OSX: launchctl load ~/Library/LaunchAgents/net.pro-manage.hatch.ssh-tunnel.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
</dict>
@kyxap1
kyxap1 / filter.txt
Created April 4, 2018 12:49
uBlock Origin filters
youtube.com##.ytp–ce–element
youtube.com##.ytp–ce–covering–overlay
youtube.com##.ytp–ce–element–shadow
youtube.com##.ytp–ce–covering–image
youtube.com##.ytp–ce–expanding–image
youtube.com##.ytp–ce–element.ytp–ce–channel.ytp–ce–channel–this.ytp–ce–element–show.ytp–ce–bottom–right–quad.ytp–ce–size–640
youtube.com##.ytp–ce–element.ytp–ce–video.ytp–ce–element–show
youtube.com##.ytp–expand
youtube.com##.ytp–pause–overlay
youtube.com###watch7-sidebar-contents
@kostyrev
kostyrev / MRs.md
Last active November 15, 2021 08:28
MRs
git checkout master
git pull --no-edit origin $(git rev-parse --abbrev-ref HEAD) --rebase --ff-only
git checkout -b new-feature
git commit ...

...

@kyxap1
kyxap1 / vpnc_server_script.sh
Created December 3, 2017 07:02
VPN routing script for Asus RT-N56U
#!/bin/sh
### Custom user script
### Called after internal VPN client connected/disconnected to remote VPN server
### $1 - action (up/down)
### $IFNAME - tunnel interface name (e.g. ppp5 or tun0)
### $IPLOCAL - tunnel local IP address
### $IPREMOTE - tunnel remote IP address
### $DNS1 - peer DNS1
### $DNS2 - peer DNS2
@kyxap1
kyxap1 / test-cloud-init-run.sh
Created November 1, 2017 00:47 — forked from maoueh/test-cloud-init-run.sh
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final