View edithosts.bat
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
@echo off | |
REM Note - this will not work if npp is already running without admin privledges | |
:checkPrivileges | |
NET FILE 1>NUL 2>NUL | |
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) | |
:getPrivileges | |
if '%1'=='ELEV' (shift & goto gotPrivileges) |
View switchpages.php
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
<? | |
//Gets the document name of the page. For example, index.php | |
$getDocument = explode('/', $_SERVER["PHP_SELF"]); | |
$currentPage = $getDocument[count($getDocument) - 1]; | |
//Switch statement | |
switch ($currentPage) { | |
case "index.php": | |
//do something unique on index.php | |
break; |
View quickedit
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
REG.EXE add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f |
View checkVPSandReboot.py
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/python | |
import httplib | |
import subprocess | |
############################## Site To Check ################################# | |
VAR_hostname = "yoursite.com" | |
VAR_path = "/" | |
######################### DigitalOcean Variables ############################# | |
VAR_dropletID = "123456" | |
VAR_Token = "YOUR_API_TOKEN_HERE" |
View restoretime.sql
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
declare @sql_text char(255); | |
declare @total_time_so_far int; | |
declare @total_percent float; | |
declare @seconds_per_percent float; | |
declare @total_time time; | |
declare @time_left time; | |
SELECT @sql_text = sqltext.TEXT, | |
@total_time_so_far = req.total_elapsed_time, |
View copytosubdirectories.bat
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
@ECHO OFF | |
REM | This script will take all files and subdirectories in | |
REM | C:\Source and copy them into a new folder called "Config" in | |
REM | all subdirectories of C:\Dest. If there are no subdirectories, | |
REM | nothing will happen | |
REM | | |
REM | ie - C:\Source\*.* will be copied to C:\Dest\Folder\Config\*.* | |
REM | assuming "Folder" was a preexisting subdirectory | |
REM :: Define Variables Here :: |
View datetimestamp.bat
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
@ECHO OFF | |
for /f "usebackq" %%x in (`powershell "get-date -f yyyy-MM-dd_HH:mm:ss"`) do set datetimestamp=%%x | |
echo %datetimestamp% | |
pause |
View gist:e8a133639e5ff5fa5156
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
openssl pkcs12 -in ./cert.pfx -clcerts -nokeys -out public.crt | |
openssl pkcs12 -in ./cert.pfx -nocerts -nodes -out private.rsa | |
cat public.crt ca-bundle.crt >> bundle.crt |
View stopredis.sh
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
for f in /etc/init.d/redis*; do $f status; done |
View gist:867db8bef87442744092
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
tar -cvzf filename.tar.gz -C /path/to/archive . |
OlderNewer