a
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
#!/usr/bin/env python3 | |
""" | |
The MIT License (MIT) | |
Copyright (C) 2017-2020 Joe Testa ([email protected]) | |
Copyright (C) 2017 Andris Raugulis ([email protected]) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
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
<?php | |
// 2019-01-28: Tested with PHP 7.0.32 (AR) | |
// tested with PHP 7.1.7 | |
$start = microtime(true); | |
const LOGIN_KEY_LEN = 20; | |
const MY_LOGIN_HEADER_LEN = 24; | |
const MAX_CIPHER_STORE_LEN = 4; |
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
<# | |
================================================================================ | |
===== WordPress Installation Script for Windows Server 2016 and Windows 10 ===== | |
================================================================================ | |
#> | |
"`r`nWordPress Installation Script for Windows Server 2016 and Windows 10" | |
"====================================================================" | |
cd ~\Downloads |
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
$sourcefile = read-host "Enter source file path" | |
$destfile = read-host "Enter destination file path" | |
$content = Get-Content -Path $sourcefile -Encoding Byte | |
$Base64 = [System.Convert]::ToBase64String($Content) | |
Invoke-Command -computername <computername> -credential (get-credential) -scriptblock {$x = [System.Convert]::FromBase64String($Using:Base64); Set-Content -Path $using:destfile -Value $x -Encoding Byte} |
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
$SourceRoot = "C:\foo" | |
$DestRoot = "C:\blah" | |
$SourceContent = Get-ChildItem $SourceRoot -Recurse | |
$SourceContent | foreach { | |
If ($_.PSIsContainer) {$NewItemType = "Directory"} | |
Else {$NewItemType = "File"} | |
$newitem = ($_.fullname).replace($SourceRoot, $DestRoot) | |
New-Item $newitem -ItemType $NewItemType -force | |
} |
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
On the server: | |
- Create a .ssh directory in the user's profile. | |
- Create a file named "authorized_keys" in the .ssh directory. | |
- Grant permissions on the directory - only the owner can read, write, or open the directory. | |
- Grant permissions on the file - owner can read and write. | |
On the client: | |
- Generate a key pair using PuTTY Key Generator (puttygen.exe). | |
- Right-click in the text field labelled Public key for pasting into | |
OpenSSH authorized_keys file and choose 'Select All'. |
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
# foreach pipeline without format-table | |
$col = 1,2,3 | |
$col | foreach { | |
write-host "Doing thing $($_)..." | |
get-childitem C:\windows\regedit.exe | |
} | |
# Output: |
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
$TriggerParams = @{ | |
Daily = $true | |
At = '12am' | |
ErrorAction = 'Stop' | |
} | |
$SettingsParams = @{ | |
ExecutionTimeLimit = [TimeSpan]::FromHours(2) | |
ErrorAction = 'Stop' | |
} | |
$TaskParams = @{ |
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
# -*- coding:utf-8 -*- | |
# Bot2Human | |
# | |
# Replaces messages from bots to humans | |
# typically used in channels that are connected with other IMs using bots | |
# | |
# For example, if a bot send messages from XMPP is like `[nick] content`, | |
# weechat would show `bot | [nick] content` which looks bad; this script | |
# make weecaht display `nick | content` so that the messages looks like | |
# normal IRC message |
NewerOlder