Skip to content

Instantly share code, notes, and snippets.

View erwinowak's full-sized avatar
🎯
Focusing

Erwin Nowak erwinowak

🎯
Focusing
View GitHub Profile
@erwinowak
erwinowak / help.py
Created September 8, 2020 14:15 — forked from jpanahon/help.py
Help example for the rewrite branch of discord.py
# NOTICE: Before you copy this example, be sure you understand what all this does. Remember: This is a gist, not a github file meaning
# you can't pip install this, you would need to put this into a new file and add it to your cog list.
import discord
import asyncio
from discord.ext import commands
def chunks(l, n):
@erwinowak
erwinowak / index.js
Created September 16, 2018 09:20
Simple, complete example of a bot in Discord.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
#!/bin/bash### MySQL Server Login Info ###
MUSER="USERNAME"
MPASS="PASSWORD"
MHOST="localhost"
MYSQL="$(which mysql)"
@erwinowak
erwinowak / tools.sh
Created March 21, 2018 22:29 — forked from mpalpha/tools.sh
menu dialog
#!/bin/sh
show_menu(){
NORMAL=`echo "\033[m"`
MENU=`echo "\033[36m"` #Blue
NUMBER=`echo "\033[33m"` #yellow
FGRED=`echo "\033[41m"`
RED_TEXT=`echo "\033[31m"`
ENTER_LINE=`echo "\033[33m"`
echo -e "${MENU}*********************************************${NORMAL}"
echo -e "${MENU}**${NUMBER} 1)${MENU} Mount dropbox ${NORMAL}"
@erwinowak
erwinowak / cmder.md
Created February 25, 2018 18:27 — forked from nickautomatic/cmder.md
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
## TeamSpeak 3 Server - Autostart Service Script (LSBInitScript) ##
Init file: "/etc/init.d/tsserver"
Runtime user: "ts"
TeamSpeak server dir: "/home/ts/teamspeak3-server/<your tsserver>"
Install: "chmod 0755 /etc/init.d/tsserver && cd /etc/init.d/ && insserv tsserver && cd - > /dev/null"
Autostart after reboot: "update-rc.d tsserver defaults"
Usage: tsserver {start|stop|status|restart} "/etc/init.d/tsserver status" "service tsserver status"
enjoy
@erwinowak
erwinowak / mysql.php
Created January 27, 2018 20:05 — forked from ivorisoutdoors/mysql.php
Simple PHP MySQL Class
<?php
class Mysql{
static private $link = null;
static private $info = array(
'last_query' => null,
'num_rows' => null,
'insert_id' => null
);
@erwinowak
erwinowak / mysql_backup.sh
Created December 30, 2017 13:23 — forked from chill117/mysql_backup.sh
Bash script to perform backups on one or more MySQL databases.
#!/bin/bash
#
# Use this script to perform backups of one or more MySQL databases.
#
# Databases that you wish to be backed up by this script. You can have any number of databases specified; encapsilate each database name in single quotes and separate each database name by a space.
#
# Example:
# databases=( '__DATABASE_1__' '__DATABASE_2__' )
@erwinowak
erwinowak / xcol_bash.sh
Created December 28, 2017 16:47 — forked from nachoparker/xcol_bash.sh
colorize your stdout with xcol for bash
#!/bin/bash
# Simple colorize for bash by means of sed
#
# Copyright 2008-2015 by Andreas Schamanek <andreas@schamanek.net>
#
# 2017 - Modified from mycolorize into a shell function
# by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
#
# GPL licensed (see end of file) * Use at your own risk!
#
@erwinowak
erwinowak / dumper.sh
Created December 27, 2017 20:33 — forked from TheHiddenHaku/dumper.sh
Backup All MySQL dbs in separate files
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/backup/$TIMESTAMP"
MYSQL_USER="backup"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="password"
MYSQLDUMP=/usr/bin/mysqldump
mkdir -p "$BACKUP_DIR/mysql"