Skip to content

Instantly share code, notes, and snippets.

View masato9000's full-sized avatar

masato9000

View GitHub Profile
@masato9000
masato9000 / duckdns.sh
Created January 29, 2022 06:12
DuckDNS updater for (open)BSD
#!/bin/sh
#
# duckdns.sh -d <domain[,...,domain]> -t <token> [clear|noverify] [force]
# noverify - Don't fail if public inet address can't be bound to the router
# because of modem+gateway combos forced on you by shitty ISPs.
# CAUTION: It's best if your NAT is 1:1 or you at least have some control
# over port forwarding, or DDNS isn't going to be as useful...
# force - Always update, even if the logs indicate no change is necessary
# clear - Not allowed with or "noverify"
#
#!/bin/sh
_bsdl='
Copyright (c) 2021, masato9000@users.noreply.github.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
# Some history manipulations for Korn shells. Potential side effects unknown.
# The idea is that I don't want to commit to having a separate history file
# for EVERY interactive shell or deal with merging per-instance histories back
# into the main history, but sometimes it's nice to have a different history
# in the current shell instance (tty, xterm, whatever)
# history+ Increment the command history file version
# history- Decrement the command history file version
# historyoff Enter subshell with no command history
# historyon Cancel historyoff (exit subshell)
@masato9000
masato9000 / randomchars
Last active September 20, 2021 22:34
Generate random text of arbirary length using selectable character sets in POSIX shells
#!/bin/sh
_bsdl='
Copyright (c) 2021, masato9000@users.noreply.github.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
@masato9000
masato9000 / shhh.vbs
Created October 24, 2018 20:01
VBscript that prompts for input and immediately discards it - for you poor Windows users...
'Copyright (c) 2018, masato9000@users.noreply.github.com
'All rights reserved.
'Redistribution and use in source and binary forms, with or without
'modification, are permitted provided that the following conditions are met:
'1. Redistributions of source code must retain the above copyright notice, this
' list of conditions and the following disclaimer.
'2. Redistributions in binary form must reproduce the above copyright notice,
' this list of conditions and the following disclaimer in the documentation
' and/or other materials provided with the distribution.
'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@masato9000
masato9000 / shhhh
Last active April 7, 2021 20:23
Shell script that prompts for input and immediately discards it
#!/bin/sh
bsdl='
Copyright (c) 2018, masato9000@users.noreply.github.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@masato9000
masato9000 / eacsh.sh
Created June 18, 2017 20:44
Single-purpose shell script for backing up CDs using cdrtools
#!/bin/sh
_bsdl='
Copyright (c) 2017, masato9000@users.noreply.github.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@masato9000
masato9000 / xcleancache
Last active May 24, 2017 08:12
dirty and (probably) inelegant script to clean an xbps cache more selectively than xbps-remove -O
#!/bin/sh
# Use: xcleancache [-n] <function>
# -n: dry run (don't delete any files)
# Available functions:
# notinstalled: Remove all cached files for non-installed packages
# pruneme <x> : Remove all but the latest (x) obsolete versions from
# the cache for each package cached.
# By default, cache operated upon is at /var/cache/xbps, but this can be
# changed by passing the cachedir variable to this script.
@masato9000
masato9000 / adobe-flash-package
Last active April 18, 2021 05:07
[OBSOLETE] Downloader/packager of flash plugins for XBPS-based systems (Void Linux)
#!/bin/sh
_bsdl='
Copyright (c) 2017, masato9000@users.noreply.github.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.