Skip to content

Instantly share code, notes, and snippets.

View dgibbs64's full-sized avatar

Daniel Gibbs dgibbs64

View GitHub Profile
@ar1a
ar1a / comp.cfg
Created October 1, 2023 07:22
Dathost cs2 configs
// >>> DatHost Competitive Config 0.1 <<< //
// Reset from Practice to Competitive
sv_cheats "false" // Disable cheats
mp_ct_default_grenades "" // Spawn CTs without grenades
mp_t_default_grenades "" // Spawn Ts without grenades
sv_showimpacts "0" // Don't show bullet impacts
sv_falldamage_scale "1" // Enable fall damage
sv_full_alltalk "0" // Disable voice chat with anyone
@Kr3m
Kr3m / playercount.sh
Created October 3, 2021 14:15
Retrieve total number of Steam players currently playing a game.
#Usage: ./playercount.sh "Warfork"
#!/bin/bash
appid=$(curl -s https://api.steampowered.com/ISteamApps/GetAppList/v0002/ | jq ".applist.apps[] | select(.name==\"$1\")" | jq '.appid')
curl -s https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?appid="$appid" | jq '.response.player_count'
@Kr3m
Kr3m / check.sh
Last active March 26, 2023 20:36
Restart LinuxGSM based Left 4 Dead 2 server that is both empty and not running the default map.
#!/bin/bash
#depends on gamedig being installed globally
#place in /home/l4d2server (can probably work with other LGSM servers with minor modifications).
gameserver="l4d2server"
game="left4dead2"
config_path="./lgsm/config-lgsm/$gameserver/"
server="1.1.1.1" #change to server ip
for i in $(find . -maxdepth 1 -name "$gameserver*" | sed 's|^./||'); do
defaultmap=$(grep -P '^(?=[\s]*+[^#])[^#]*(defaultmap)' $config_path$i.cfg | awk -F\" '{print $2}')
port=$(grep -P '^(?=[\s]*+[^#])[^#]*(port)' $config_path$i.cfg | grep -v 'client' | awk -F\" '{print $2}')
@papanito
papanito / ansible-galaxy-find-role-id.sh
Last active June 28, 2023 15:02 — forked from pavlov99/ansible-galaxy-find-role-id.sh
Find your role's id in ansible-galaxy
$ ansible-galaxy role info YourUser.RoleName | grep -E 'id: [0-9]' | awk {'print $2'}
@Webreaper
Webreaper / docker-compose.yml
Last active July 26, 2024 13:44
Sample Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes Plex and get_iplayer containers, which are not routed through the VPN.
# Docker compose to set up containers for all services you need:
# VPN
# Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
# Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
# /volume1/dockerdata. - root where this docker-compose.yml should live
# /volume1/dockerdata/plex - Plex config and DB
# /volume1/dockerdata/sonarr - Sonarr config and DB
@tiagocardosos
tiagocardosos / clear_binary_log_mysql.txt
Last active March 5, 2024 12:18
MySQL Clear Binary Log
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server
@pavlov99
pavlov99 / ansible-galaxy-find-role-id.sh
Created March 27, 2017 07:11
Find your role's id in ansible-galaxy
$ ansible-galaxy info YourUser.RoleName | grep -E 'id: [0-9]' | awk {'print $2'}
@pawilon
pawilon / gitlab.cfg
Created October 24, 2016 22:57
Fail2ban filter for gitlab. Tested with gitlab version 8.13 and fail2ban version 0.9.4
# cat /etc/fail2ban/filter.d/gitlab.conf
# fail2ban filter configuration for gitlab
# Author: Pawel Chmielinski
[Init]
maxlines = 6
[Definition]
# The relevant log file is in /var/log/gitlab/gitlab-rails/production.log
@faishal
faishal / upgrade-openssh-7.3p1-centos-6.7.sh
Created October 6, 2016 14:02
Upgrade OpenSSH to 7.3p1 in Cent OS 6
#!/bin/bash
# Copyright © 2016 Faishal Saiyed
cd
timestamp=$(date +%s)
if [ ! -f openssh-7.3.zip ]; then wget https://github.com/faishal/openssh-portable/releases/download/cent.os.6.7.openssh.7.3p1/openssh-7.3.zip; fi;
unzip -o openssh-7.3.zip -d openssh-7.3p1
cd openssh-7.3p1/
cp /etc/pam.d/sshd pam-ssh-conf-$timestamp
rpm -U *.rpm
yes | cp pam-ssh-conf-$timestamp /etc/pam.d/sshd
@agunnerson-ibm
agunnerson-ibm / human_readable.sh
Last active May 22, 2024 07:27
Bash function to convert bytes to human readable size
# Copyright 2015 Andrew Gunnerson <andrewgunnerson@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,