- Top level folders are upper-case.
- Windows computer names are upper-case.
- Linux computer names are lower-case.
- Computer names:
- DT10: My desktop with Windows 10 on it.
- PB10: My laptop (HP Probook) with Windows 10 on it.
This file contains 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
$profileBase = "C:\odrive\G\PC_PB10\geost\" | |
$exclude = @( | |
'Links', '.asdm', '3D Objects', 'Google Drive', 'Viasfora', 'Tracing', 'Searches', '.ssh' | |
) | |
$folders = Get-ChildItem -Attributes Directory -Exclude $exclude -Path "C:\Users\geost" | |
Write-Host $folders | |
foreach($f in $folders){ | |
$cmd = 'mklink /D "' + ($profileBase+($f.Name)) + '" "' + $f.FullName + '"' | |
echo $cmd | |
cmd /c $cmd |
This file contains 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
# Usage: purge_cloudflare.sh <public folder where hugo is hosted from> <base url of website> | |
# Example: | |
# purge_cloudflare.sh /var/www/ "https://example.com/" | |
key="<api_key>" | |
id="<zone_id>" | |
email="<email>" | |
inDir=$1 # eg. example.com | |
baseUrl=$2 # eg. example.com |
This file contains 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 | |
# Don't want to do a few things if DEBUG=="debug" | |
DEBUG=$1 | |
# CD to the directory containing the notes repo. | |
cd /home/gitworkflowy/gitwf | |
if [ "$DEBUG" != "debug" ]; then | |
./main # Source: https://github.com/jacobhands/gitworkflowy/blob/master/main.go | |
fi | |
cd notes # The repo where we keep the notes including WorkFlowy.md | |
# Generate new file name. |
This file contains 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
docker rm -v $(docker ps -a -q -f status=exited) | |
docker rmi $(docker images -f "dangling=true" -q) | |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes |
This file contains 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
sudo docker run --name gogs-postgres \ | |
-e POSTGRES_USER=git \ | |
-e POSTGRES_PASSWORD=Passw0rd \ | |
-e POSTGRES_DB=gogs \ | |
-d postgres | |
sudo docker run --name=gogs \ | |
-p 10022:22 \ | |
-p 10080:3000 \ | |
-v /var/gogs:/data \ | |
--link gogs-postgres:postgres \ |
This file contains 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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true,Position=1)] | |
[string]$StreamName, | |
[Parameter(Position=2)] | |
[int]$Quality=1, | |
[Parameter()] | |
[bool]$Retry=$true, | |
[Parameter()] | |
[int]$RetryTimeout=10 |
This file contains 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
$urlRegex="https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)" | |
$links=@() | |
function Scrape([string]$Url){ | |
(wget $Url).Links.href | Where-Object {$_ -match $urlRegex -and -not $global:links.Contains($_)} | ForEach-Object{ | |
$global:links+=$_ | |
echo $($global:links.Count.ToString() + " : " + $_) | |
Scrape -Url $_ | |
} | |
} | |
Scrape -Url "https://technet.microsoft.com/en-us/magazine/2007.11.powershell.aspx" |
This file contains 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 | |
PATH=$PATH:/usr/local/bin | |
H=/home/git | |
GOGS=$H/gogs | |
# run postgres dump | |
docker exec gogs-postgres pg_dump -U gogs -Fc gogs -f /var/pgbackup/gogs.dump | |
sleep 600 | |
hb backup \ | |
-c /home/git/hb \ | |
-D1g \ |