Skip to content

Instantly share code, notes, and snippets.

View jpylypiw's full-sized avatar
⚜️
A user interface is like a joke. If you have to explain it, it's not that good.

Jochen P. jpylypiw

⚜️
A user interface is like a joke. If you have to explain it, it's not that good.
View GitHub Profile
@jpylypiw
jpylypiw / Debian Setup.md
Last active January 13, 2020 19:31
Debian server setup

Debian server setup

Description

This my type of setting up a debian non-gui root server. Use this at your own risk! I use debian for a long time and added some configuration that prevented some errors. If you have questions or suggestions please contact me.

At installing time of the server I use the DVD-Image and set up the server using a full qualified domain name. When it comes to partitioning the server I always use the entire disk as one partition. This is because I don't want to think about placing any files into the wrong partition. Also I mostly use the opt folder instead of the home folder to place some scripts or software.

Setup Steps

@jpylypiw
jpylypiw / mssql_index.sql
Last active October 6, 2018 13:35
Useful Microsoft SQL-Server Commands
-- ----------------
-- Reorganize Index
-- ----------------
USE MYDATABASE;
GO
EXECUTE sp_msForEachTable 'SET QUOTED_IDENTIFIER ON; ALTER INDEX ALL ON ? REBUILD;'
GO
EXECUTE sp_msForEachTable 'SET QUOTED_IDENTIFIER ON; ALTER INDEX ALL ON ? REORGANIZE;'
GO
@jpylypiw
jpylypiw / apache.md
Last active October 4, 2017 13:24
Apache Configuration Examples

Apache Configuration Examples

Generically Redirect HTTP TO HTTPS

<VirtualHost *:80>
        RewriteEngine On
        RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
@jpylypiw
jpylypiw / update_check_mk_agent.sh
Last active July 2, 2024 18:01
Check_MK Agent Update Script
#!/bin/bash
# this script works with the latest version of Check_MK. Tested using Raw 1.6.0b7 on Debian and RedHat.
# be sure that curl is installed!
# apt install -y curl
# yum install -y curl
# use the script with these steps:
# curl -Os -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/jpylypiw/f55352de920b75cccbe6e50c6ad4b4cd/raw/update_check_mk_agent.sh
@jpylypiw
jpylypiw / example.service
Last active October 1, 2019 21:50
Linux Service
# Example File: /etc/systemd/system/owapi.service
# Use this for creating a new linux service.
# Execute `systemctl daemon-reload` after creating the file.
# remove these comments!
[Unit]
Description=OWAPI - Overwatch API server process
Wants=network-online.target
After=syslog.target time-sync.target network.target network-online.target
@jpylypiw
jpylypiw / Game.ini
Created December 28, 2017 09:14
The Isle Game.ini
[/script/theisle.igamesession]
ServerName=xxx
ServerPassword=
ServerSteamGroup=
ServerMOTD=Hi There :3
bFamilySharing=false
bServerDatabase=true
bServerAllowChat=true
bServerGlobalChat=true
bServerNameTags=true
@jpylypiw
jpylypiw / sources.list
Last active October 6, 2018 13:30
Debian APT Sources (sources.list) for stable usage
# Debian sources.list for continuous release upgrades.
# I changed the normal release name to "stable". This means debian is updating to the next release if available.
# Stable Main
deb http://ftp.de.debian.org/debian/ stable main
deb-src http://ftp.de.debian.org/debian/ stable main
# Security Updates Stable Main
deb http://security.debian.org/ stable/updates main
deb-src http://security.debian.org/ stable/updates main
@jpylypiw
jpylypiw / mysql2sqlite.sh
Created January 16, 2018 22:35 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jpylypiw
jpylypiw / auto-update.md
Last active June 6, 2024 17:05
Pterodactyl Source Server Auto-Update

Update source games (CS:GO etc.) on server start/restart

you can add these params to srcds startup: -autoupdate -steam_dir steamcmd -steamcmd_script update.txt

create an "update.txt" file inside steamcmd folder with the following content:

// update.txt
//
@jpylypiw
jpylypiw / shrink-filesystem.md
Created October 31, 2018 11:00
Keep size of virtual Filesystem small

Old Way:

dd if=/dev/zero of=zero.small.file bs=1024 count=102400
dd if=/dev/zero of=zero.file bs=1024
rm zero.small.file
sync ; sleep 60 ; sync
rm zero.file

in a windows vm you can use sdelete:
sdelete.exe -z c::