Skip to content

Instantly share code, notes, and snippets.

@ivanhub
ivanhub / sql_rename
Created October 4, 2022 09:28
sql rename database
ALTER DATABASE 1OLD_DBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE 1OLD_DBName MODIFY NAME = 2NEW_DBNAME;
ALTER DATABASE 2NEW_DBNAME SET MULTI_USER WITH ROLLBACK IMMEDIATE;
@ivanhub
ivanhub / git_proxy.sh
Created October 4, 2022 06:52
git bash (windows) proxy configuration
1.
set http_proxy=http://username:password@:8080
set https_proxy=http://username:password@ipaddress:8080
set no_proxy=localhost,.my.company
2.
git config --global http.proxy http://username@ip:8080
git config --global credential.helper wincred
@ivanhub
ivanhub / runas.cmd
Created October 4, 2022 06:48
runas
1.
$Credential = New-Object System.Management.Automation.PSCredential domain\user, password
Start-Process powershell.exe -Credential $Credential -ArgumentList "-file $FILE"1
2.
runas.exe /noprofile /env /user:domain\login "powershell.exe"
@ivanhub
ivanhub / SSMS_external_drives.txt
Created October 4, 2022 06:46
SQL (ssms) using external network drives
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GO
@ivanhub
ivanhub / nox-ad-block.txt
Created March 3, 2021 17:17
nox adware block
netsh advfirewall firewall add rule name="Nox Block In" dir=in action=block remoteip=220.181.0.0-220.181.255.255,183.128.0.0-183.143.255.255,182.92.0.0-182.92.255.255,101.200.0.0-101.201.255.255,211.151.0.0-211.151.255.255,198.11.128.0-198.11.191.255,124.160.0.0-124.160.255.255,140.205.0.0-140.205.255.255,110.173.192.0-110.173.223.255,121.52.224.0-121.52.255.255,178.162.216.0-178.162.219.255
netsh advfirewall firewall add rule name="Nox Block Out" dir=out action=block remoteip=220.181.0.0-220.181.255.255,183.128.0.0-183.143.255.255,182.92.0.0-182.92.255.255,101.200.0.0-101.201.255.255,211.151.0.0-211.151.255.255,198.11.128.0-198.11.191.255,124.160.0.0-124.160.255.255,140.205.0.0-140.205.255.255,110.173.192.0-110.173.223.255,121.52.224.0-121.52.255.255,178.162.216.0-178.162.219.255
127.0.0.1 api.bignox.com
127.0.0.1 tracking.trnox.com
127.0.0.1 bi.yeshen.com
127.0.0.1 launcher.us.yeshen.com
127.0.0.1 pubstatus.sinaapp.com
127.0.0.1 noxagile.duapp.com
@ivanhub
ivanhub / curlmirror
Created January 31, 2021 16:10 — forked from ivanvc/curlmirror
Mirrors a web site by using curl to download each page.
#!/usr/bin/env perl
#
# curlmirror.pl
#
# Mirrors a web site by using curl to download each page.
# The result is stored in a directory named "dest" by default.
# Temporary files are stored in "/tmp".
#
# Author: Kjell.Ericson@haxx.se
#
@ivanhub
ivanhub / Uniq.id.JS
Created September 22, 2020 06:55
JS.Uniq.ID.techniques
'-' + Math.random().toString(36).substr(2,12) + Math.random().toString(36).substr(2, 12)
Date.now() + Math.random().toString().slice(2);
Math.random().toString(36).slice(2);
Math.floor(Math.random() * Math.floor(Math.random() * Date.now()))
'_' + (new Date().getUTCMilliseconds().toString() + new Date().getTime().toString()).toString();
---
function myUniqueID(){
return Math.random().toString(36).slice(2);
@ivanhub
ivanhub / uwf-add-exclusions.cmd
Created November 20, 2019 17:24
UWF add exclusions (my full list)
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\BITS\StateIndex"
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Wireless\GPTWirelessPolicy"
uwfmgr file add-exclusion %ALLUSERSPROFILE%\Microsoft\Network\Downloader
uwfmgr file add-exclusion C:\Windows\wlansvc\Policies
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\wlansvc
uwfmgr file add-exclusion C:\ProgramData\Microsoft\wlansvc\Profiles\Interfaces
@ivanhub
ivanhub / ramspeed.cmd
Created October 16, 2019 17:24
ram speed win command
wmic memorychip get speed
@ivanhub
ivanhub / server.ovpn
Created September 28, 2019 12:01
Working configuration of OpenVPN Server
port 443
proto udp
dev tun
dev-node "VPN Server"
dh "C:\\Program Files\\OpenVPN\\ssl\\dh2048.pem"
ca "C:\\Program Files\\OpenVPN\\ssl\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\ssl\\servername.crt"
key "C:\\Program Files\\OpenVPN\\ssl\\servername.key"
server 172.16.10.0 255.255.255.0
push "redirect-gateway autolocal"