This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
###################################################################### | |
# purpose : show git status for all local repos found under given path | |
# author : njd | |
# created : 2017-Apr-21 | |
# usage : ./all-git-status.sh [path] [| less -r] | |
###################################################################### | |
ESC="\033" | |
NORMAL="$ESC[m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
####################################################### | |
# purpose : "git pull" all sub .gits for a given path | |
# author : njd | |
# created : 2015-03-05 | |
# modified : 2017-04-21 | |
# usage : ./pull-all-gits.sh [path] | |
####################################################### | |
ESC="\033" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# edit username | |
username='username' #because i autostart in init.d, i dont want to execute as root | |
cd ~/minecraft/server || exit 1 | |
case $1 in | |
"1.10") | |
server="spigot-1.10.jar";; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# append your ~/.bashrc to include | |
# PROMPT_COMMAND=~/path/to/gitstatus.sh | |
# skip a line irregardless | |
echo | |
echo $'\e[7m' $(date +"%b %d; %H:%M:%S")' '$'\e[m' #date in reverse color | |
# only run if in a git repo root | |
if [[ -e .git ]] ; then | |
#if you dont want to see modified files, uncomment pipe to head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/ioctl.h> | |
#include <asm/ioctls.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
// code by "dma" via https://forums.gentoo.org/viewtopic-p-2455159.html#2455159 | |
int main(int argc, char *argv[]) { | |
int fd; | |
char shift_state; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" = "" ] ; then | |
folder=$(pwd) | |
else | |
folder=$1 | |
fi | |
echo "" | |
date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Powershell function to determine if machine requires reboot. | |
by Michael Simmons : http://ilovepowershell.com/2015/09/10/how-to-check-if-a-server-needs-a-reboot/ | |
Adapted from https://gist.github.com/altrive/5329377 | |
Based on <http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542> | |
#> | |
function Test-PendingReboot | |
{ | |
if (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA Ignore) { return $true } | |
if (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA Ignore) { return $true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
shift_state=$(sudo ~/scripts/shift_state) #https://gist.github.com/meoso/b46b441b31344804c6837829e059c2b8 | |
if (( $shift_state )) ; then | |
killall remmina | |
rm -f ~/.freerdp/known_hosts | |
else | |
RWindow="" | |
RWindow=$(wmctrl -l | grep "Remmina Remote Desktop Client") | |
if [ -z "$RWindow" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OU="OU=TheOUName,DC=yourdomain,DC=com" | |
$ShadowGroup="CN=ShadowGroupName,OU=TheOUName,DC=yourdomain,DC=com" | |
Import-Module ActiveDirectory | |
(Get-ADGroup -Identity $ShadowGroup -properties members).Members | Get-ADUser | Where-Object {$_.distinguishedName –NotMatch $OU} | ForEach-Object {Remove-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup –Confirm:$false} | |
Get-ADUser –SearchBase $OU –SearchScope OneLevel –LDAPFilter "(!memberOf=$ShadowGroup)" | ForEach-Object {Add-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Title | Host | Username | Domain | Resolution | AdditionalParams | |
---|---|---|---|---|---|---|
user@example | host01 | username | domain.com | 1920x1200 | +clipboard /cert-tofu | |
anothermachine | machine74 | username | domain.com | 1920x1200 | +clipboard /cert-tofu | |
admin@thatothermachineiforget | examplehostname | administrator | domain.com | 1920x1200 | +clipboard /cert-tofu |