Skip to content

Instantly share code, notes, and snippets.

set gfxpayload=text
set ISODIR=/LINUX
set PARAMS=splash
probe -u $LINUX --set=PARTUUID
export ISODIR PARAMS PARTUUID gfxpayload
insmod regexp
for f in ($LINUX)$ISODIR/*.iso; do
regexp -s "1:basename" "$ISODIR/(.*)\$" $f
type="os"
@ngobach
ngobach / SQL_SERVER_CLEANDB.SQL
Created April 22, 2017 15:41
Completely database cleaning script for M$ SQL Server
/* Drop all non-system stored procs */
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']'
EXEC (@SQL)
@ngobach
ngobach / Fix.MD
Created July 7, 2017 15:52
L2PT/IPSec NAT-T fix for windows

For Windows Vista, 7, 8.x and 10

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent /v AssumeUDPEncapsulationContextOnSendRule /t REG_DWORD /d 0x2 /f

For Windows XP ONLY

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\IPSec /v AssumeUDPEncapsulationContextOnSendRule /t REG_DWORD /d 0x2 /f
@ngobach
ngobach / cloudSettings
Last active October 7, 2017 17:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-10-07T17:15:57.765Z","extensionVersion":"v2.8.3"}
version: "3"
services:
database:
image: mongo:latest
networks:
bachnx:
server:
image: thanbaiks/mp3-server:latest
ports:
- 8000:8000
@ngobach
ngobach / virtualbox.txt
Created September 12, 2017 16:29
VirtualBox configs for OSX
./VBoxManage.exe modifyvm "Mac" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
./VBoxManage.exe setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
./VBoxManage.exe setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
./VBoxManage.exe setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983FE1663"
./VBoxManage.exe setextradata "Mac" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
./VBoxManage.exe setextradata "Mac" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
./VBoxManage setextradata "macOS Sierra" "VBoxInternal2/EfiGopMode" 1
1 gives you a resolution of 800×600
2 gives you a resolution of 1024×768
@ngobach
ngobach / 00_hackintosh.md
Last active November 3, 2019 17:20
Idiot's guide to hackintosh. https://git.io/vhwSM
@ngobach
ngobach / readme.md
Last active October 10, 2017 14:42

Just a test

This is the first paragraph.

And this is the second.

npm install -S something
npm run start

I. Rain

Dùng stack để tính lượng mưa tạo thành bởi cột đó và các cột bên trái nó. (hơi phức tạp)

J. Sale

Số nhỏ nhất trong dãy chắc chắn là giá tiền đã giảm. Loại bỏ nó và số = 4/3 nhân với nó ra khỏi dãy (dùng map để đánh dấu đã xóa). Xóa xong cả 2 số rồi thì số nhỏ nhất tiếp theo sẽ chắc chắn là giá tiền mới. cứ thế đến khi nào hết toàn bộ dãy.