Skip to content

Instantly share code, notes, and snippets.

@non7top
non7top / remove_crw.cmd
Created Feb 6, 2020 — forked from xvitaly/remove_crw.cmd
Remove telemetry updates for Windows 7 and 8.1
View remove_crw.cmd
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@non7top
non7top / remove-win10-spyware.bat
Created Feb 6, 2020 — forked from zorchenhimer/remove-win10-spyware.bat
Remove all the nasty stuff that was backported to Windows 7 and 8 from Windows 10.
View remove-win10-spyware.bat
@echo off
AT > NUL
if %ERRORLEVEL% EQU 1 (
echo Error: Not running as administrator.
echo Please right click the batch file and select 'Run as Administrator'
exit /b 1
)
echo Uninstalling bad updates...
@non7top
non7top / print_to_pdf.bas
Created Sep 5, 2019
LibreOffice Calc macros to print selected pages into pdf
View print_to_pdf.bas
sub print_to_pdf2
if len(ThisComponent.getURL())=0 then
msgbox "Save document first!"
exit sub
end if
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
GlobalScope.BasicLibraries.LoadLibrary("Tools")
End If
View dump_http_headers.sh
# https://serverfault.com/a/633452
stdbuf -oL -eL /usr/sbin/tcpdump -A -s 10240 -i lo "tcp port 82 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | egrep -a --line-buffered ".+(GET |HTTP\/|POST )|^[A-Za-z0-9-]+: " | perl -nle 'BEGIN{$|=1} { s/.*?(GET |HTTP\/[0-9.]* |POST )/\n$1/g; print }'
@non7top
non7top / check_http_wget
Created Feb 12, 2019
nagios site check, uses curl
View check_http_wget
#!/bin/bash
exec 2>&1
[ -d /dev/shm -a -w /dev/shm ] && export TMPDIR=/dev/shm
# Parsing Input Parameters {{{
#####################################################################
allparams=$*
g_myname_pid=$$
@non7top
non7top / recode.sh
Created Sep 8, 2018 — forked from cstroie/recode.sh
Recode MP3 files with normalization
View recode.sh
#!/bin/bash
#
# recode
#
# Copyright 2011 Costin STROIE <costinstroie@eridu.eu.org>
#
@non7top
non7top / super-tip.txt
Created Jan 18, 2018 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
View super-tip.txt
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
View nginx-lua-s3.nginxconf
location ~* ^/s3/(.*) {
set $bucket '<REPLACE WITH YOUR S3 BUCKET NAME>';
set $aws_access '<REPLACE WITH YOUR AWS ACCESS KEY>';
set $aws_secret '<REPLACE WITH YOUR AWS SECRET KEY>';
set $url_full "$1";
set_by_lua $now "return ngx.cookie_time(ngx.time())";
set $string_to_sign "$request_method\n\n\n\nx-amz-date:${now}\n/$bucket/$url_full";
set_hmac_sha1 $aws_signature $aws_secret $string_to_sign;
set_encode_base64 $aws_signature $aws_signature;
View Bootstrap-EC2-Windows-CloudInit.ps1
# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@non7top
non7top / WinRM-Insecure-Bootstrap.ps1
Created Dec 12, 2017 — forked from thomasalley/WinRM-Insecure-Bootstrap.ps1
Quickly bootstrap a Windows host to allow insecure connections. Also creates an HTTPS listener with a self-signed cert.
View WinRM-Insecure-Bootstrap.ps1
winrm quickconfig -q -force
Enable-psremoting –force
Set-executionpolicy bypass –force
winrm set winrm/config/service/Auth '@{Basic="true"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
winrm set winrm/config/client '@{TrustedHosts="*"}'
# Configuration Warning: