Skip to content

Instantly share code, notes, and snippets.

Avatar

Boy Wijnmaalen boywijnmaalen

View GitHub Profile
@boywijnmaalen
boywijnmaalen / KMS_office.cmd
Created Oct 10, 2021 — forked from Zibri/KMS_office.cmd
KMS server Windows
View KMS_office.cmd
@echo off
title Microsoft Office 2019 versions are supported!&cls&echo
============================================================================&echo
#Project: Activating Microsoft software products for FREE without software&echo
============================================================================&echo.&echo
#Supported products:&echo - Microsoft Office Standard 2019&echo - Microsoft Office Professional Plus 2019&echo.&echo.&(if exist
"%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist
"%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo
@boywijnmaalen
boywijnmaalen / install swoole for multiple PHP versions.sh
Last active Jun 17, 2021
install swoole for multiple PHP versions
View install swoole for multiple PHP versions.sh
for i in "7.0 7.1 7.2 7.3 7.4 8.0"; do
if [ ! -d "/tmp/swoole-src" ]; then
cd /tmp
git clone https://github.com/swoole/swoole-src.git
;fi
cd /tmp/swoole-src \
if [ "${i}" = "7.0" ]; then
@boywijnmaalen
boywijnmaalen / 20210315_straced_#2
Created Mar 15, 2021
straced output PEST - segmentation error
View 20210315_straced_#2
This file has been truncated, but you can view the full file.
execve("./vendor/bin/pest", ["./vendor/bin/pest"], 0x7ffc5ba020d0 /* 27 vars */) = 0
brk(NULL) = 0x56171a1e0000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=22244, ...}) = 0
mmap(NULL, 22244, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fe2b5b3e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@boywijnmaalen
boywijnmaalen / 20210315_straced
Created Mar 15, 2021
straced output PEST - segmentation error
View 20210315_straced
execve("./vendor/bin/pest", ["./vendor/bin/pest"], 0x7fff35895520 /* 27 vars */) = 0
brk(NULL) = 0x55ccb0ed4000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=22244, ...}) = 0
mmap(NULL, 22244, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4e997cf000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
View Search .gz files for a string with lines before and after each occurence
# cd into the right directory
$ find . -name \*.gz -print0 | xargs -0 zgrep -B 35 -A 35 "Search for string"
# -A show number of lines after an occurence
# -B show number of lines before an occurence
View Remove file change from last commit
# Method #1 - revert the file and create a new commit (safe method)
$ git checkout HEAD^ -- /path/to/file
$ git add /path/to/file
$ git commit -m "revert changes on this file, not finished with it yet"
$ git push origin HEAD
# Method #2 - revert the file and update the last commit ('uncommitting' method)
# use this method only if you know what you're doing
View Sort a multidimensional array by a datetime column
<?php
/**
* sort a multidimensional array by a DateTime column
*/
$return = [
['linked' => '2018-09-13T09:59:08+00:00'],
['linked' => '2018-09-20T16:06:11+00:00'],
['linked' => '2018-09-17T14:31:33+00:00'],
@boywijnmaalen
boywijnmaalen / Git cleanup repository
Last active Nov 24, 2022
Deletes all dangling commits, objects and blobs
View Git cleanup repository
# empty the stash
$ git stash clear
# objects can also be reached through the reflog.
# while branches record the history of some project, reflogs record the history of these branches.
# if you amend, reset etc. commits are removed from the branch history
# but git keeps them around in case you realize that you made a mistake.
# reflogs are a convenient way to find out what destructive (and other) operations were performed
# on a branch (or HEAD), making it easier to undo a destructive operation.
@boywijnmaalen
boywijnmaalen / Circumvent VPN for specific IP Address
Last active Nov 8, 2018
How to let websites and IPs bypass the VPN using static routing #UNIX #MacOsX
View Circumvent VPN for specific IP Address
# https://support.hidemyass.com/hc/en-us/articles/202720646-How-to-let-websites-and-IPs-bypass-the-VPN-using-static-routing
# get gateway IP
```
$ route -n get default | grep gateway | awk '$1 == "gateway:" {print $2}'
```
# for every IP add an exception to route config
```
$ sudo route -nv add <destination IP> <gateway IP>
@boywijnmaalen
boywijnmaalen / Recover deleted files from git rm
Last active Apr 9, 2018
Recover deleted files from 'git rm' #CLI #GIT
View Recover deleted files from git rm
# Recover deleted files from 'git rm'
$ git fsck --lost-found --unreachable
# PS. Recovered files are in '.git/lost-found/other'