Skip to content

Instantly share code, notes, and snippets.

View millsoft's full-sized avatar
🔵
while 1

Michael Milawski millsoft

🔵
while 1
  • Millsoft
  • Germany
View GitHub Profile
@millsoft
millsoft / README.md
Last active June 21, 2020 13:38
Discord Github Webhook

how to install?

  • create composer.json and put the contents of the composer gist.
  • execute composer install
  • create index.php (or whatever) and put the contents from the php code inside
  • create a discord webhook and get the URL
  • put the URL in your index.php
  • use the URL to your script in a github push webhook

If you push something, this script will get called and will send the data to discord.

@millsoft
millsoft / vim_commandline.md
Last active June 9, 2019 10:19
VIM Cheatsheet

VIM Command line

you can press : and enter specific commands to modify the text.

Delete selected text to a register (like cut)

  • Select the text in visual mode, eg.:
vjjj
  • now press : the command will look like this: :'<,'>.
@millsoft
millsoft / debug-kubernetes.md
Last active June 2, 2019 20:09
kubernetes howtos

Debug Kubernetes

show logs of a pod

kubectl logs <pod-name>

Execute a command on pod

kubectl exec <pod-name> -- ls

or execute bash:

@millsoft
millsoft / minikube.md
Last active June 1, 2019 17:43
kubernetes

Start minikube on Windows 10

on machines where docker is already running and is using hyperv, you need to start minikube using hyperv:

  • At first you need to create a virtual switch in hyperv.
  • name the hyperv switch, eg Primary Virtual Switch
  • Use External network, select your network card, eg a wireless card.
  • click on OK

Now in terminal:

@millsoft
millsoft / clear-screen.php
Last active May 21, 2019 12:54
Clear CLI Console Screen with PHP
<?php
function clearTerminal () {
if (strncasecmp(PHP_OS, 'win', 3) === 0) {
popen('cls', 'w');
} else {
exec('clear');
}
}
@millsoft
millsoft / gitpush.cmd
Created May 18, 2019 20:37
git add, git commit and git push in one command
@echo off
REM git adds, commits and pushes
REM call: gitpush "commitmessage"
SET commitMessage=%1
git add .
if %ERRORLEVEL% == 0 goto :commit
goto :done
@millsoft
millsoft / fuck.ahk
Created May 1, 2019 16:44
My Autohotkey Macros
;If you press the capslock... then:
Capslock::
;play sound?.. ;)
;SoundPlay, files/fuck.mp3
CustomColor = 220000 ; Can be any RGB color (it will be made transparent below).
Gui, +AlwaysOnTop +LastFound +Owner ; +Owner prevents a taskbar button from appearing.
Gui, Color, %CustomColor%
Gui, Font, s228
Gui, Add, Text, cLime, FUCK
@millsoft
millsoft / docker-compose.yml
Created January 4, 2019 14:40
Docker Compose for web development
web:
image: nginx:latest
ports:
- "8881:80"
volumes:
- ./:/code
- ./site.conf:/etc/nginx/conf.d/site.conf
- ./logs:/var/log/nginx/
links:
- php
@millsoft
millsoft / README.md
Last active September 14, 2018 16:50
Raspberry PI configs

Tasks for new raspberry pi

When I install a new raspberry pi or similar mini computer, I need to do some tasks:

Write ISO to USB-Stick or SD-Card

dd bs=4M if=/path/to/image.iso of=/dev/sdx status=progress oflag=sync sdx should be the dev from the usb stick... I use a partition manager to find out the device.

Tasks after installation

@millsoft
millsoft / fineuploader_chunk_combiner.php
Last active June 4, 2018 07:53
Eine Alternative zum Chunk Merger für Fineploader.
<?php
//Alternativer Merger der mit Linux Funktionen die Chunks zusammenfügt.
//Wegen Domainfactory - denn dort kann man mit den Standard-Funktionen von fineuploader nur max. 2 GB große Dateien erstellen...
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(0);