Skip to content

Instantly share code, notes, and snippets.

View skorotkiewicz's full-sized avatar
💻
Programming

Sebastian Korotkiewicz skorotkiewicz

💻
Programming
View GitHub Profile
@skorotkiewicz
skorotkiewicz / oragono.service
Created June 25, 2018 01:48
systemd service for oragono ircd and qwebirc / debian
[Unit]
Description=Oragono IRCd
Wants=network.target
After=network.target
[Service]
User=irc
Type=simple
WorkingDirectory=/var/ircd/oragono/
ExecStart=/var/ircd/oragono/oragono run
@skorotkiewicz
skorotkiewicz / functions.php
Created June 11, 2018 19:01 — forked from butlerblog/functions.php
SMTP using wp-config.php for settings
<?php // Don't use this line.
/**
* This function will connect wp_mail to your authenticated
* SMTP server. This improves reliability of wp_mail, and
* avoids many potential problems.
*
* Values are constants set in wp-config.php
*/
add_action( 'phpmailer_init', 'send_smtp_email' );
Verifying my Blockstack ID is secured with the address 15Z4i46GgbZAxiVhtjLY48j7cMsyfVRU19 https://explorer.blockstack.org/address/15Z4i46GgbZAxiVhtjLY48j7cMsyfVRU19
@skorotkiewicz
skorotkiewicz / pass.md
Last active February 25, 2018 11:42 — forked from abtrout/pass.md
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ apt install pass
$ gpg --gen-key
$ gpg --list-keys
@skorotkiewicz
skorotkiewicz / wsl-go-install.sh
Last active February 18, 2018 12:22
Script to install Go 1.10 on Linux and WSL (Windows Subsystem for Linux)
#!/bin/bash
set -e
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
GVERSION="1.10"
GFILE="go$GVERSION.linux-amd64.tar.gz"
@skorotkiewicz
skorotkiewicz / docker-cleanup-resources.md
Created November 6, 2017 16:12 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@skorotkiewicz
skorotkiewicz / ubuntu-php-version-switch.txt
Created October 22, 2017 20:11 — forked from full-stack-king/ubuntu-php-version-switch.md
How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?
Switch PHP version:
From php5.6 to php7.0 :
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php
# create a new user (john for this example)
# just enter a password when asked, confirm it, and the other steps are optionals
sudo adduser john
# give root user the ownership of john's home directory
sudo chown root:root /home/john
# edit the ssh configuration file
sudo vim /etc/ssh/sshd_config
@skorotkiewicz
skorotkiewicz / speech.sh
Created May 27, 2017 19:02
Multi Google Speech in CLI
#!/bin/bash
INPUT=$*
STRINGNUM=0
ary=($INPUT)
for key in "${!ary[@]}"
do
SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
@skorotkiewicz
skorotkiewicz / seo.php
Last active May 27, 2017 10:51
SEO friendly url using php with cyrylic and more
<?php
function seo($str) {
$from = array("Á", "À", "Â", "Ä", "Ă", "Ā", "Ã", "Å", "Ą", "Æ", "Ć", "Ċ", "Ĉ", "Č", "Ç", "Ď", "Đ", "Ð", "É", "È", "Ė", "Ê", "Ë", "Ě", "Ē", "Ę", "Ə", "Ġ", "Ĝ", "Ğ", "Ģ", "á", "à", "â", "ä", "ă", "ā", "ã", "å", "ą", "æ", "ć", "ċ", "ĉ", "č", "ç", "ď", "đ", "ð", "é", "è", "ė", "ê", "ë", "ě", "ē", "ę", "ə", "ġ", "ĝ", "ğ", "ģ", "Ĥ", "Ħ", "I", "Í", "Ì", "İ", "Î", "Ï", "Ī", "Į", "IJ", "Ĵ", "Ķ", "Ļ", "Ł", "Ń", "Ň", "Ñ", "Ņ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ő", "Ø", "Ơ", "Œ", "ĥ", "ħ", "ı", "í", "ì", "i", "î", "ï", "ī", "į", "ij", "ĵ", "ķ", "ļ", "ł", "ń", "ň", "ñ", "ņ", "ó", "ò", "ô", "ö", "õ", "ő", "ø", "ơ", "œ", "Ŕ", "Ř", "Ś", "Ŝ", "Š", "Ş", "Ť", "Ţ", "Þ", "Ú", "Ù", "Û", "Ü", "Ŭ", "Ū", "Ů", "Ų", "Ű", "Ư", "Ŵ", "Ý", "Ŷ", "Ÿ", "Ź", "Ż", "Ž", "ŕ", "ř", "ś", "ŝ", "š", "ş", "ß", "ť", "ţ", "þ", "ú", "ù", "û", "ü", "ŭ", "ū", "ů", "ų", "ű", "ư", "ŵ", "ý", "ŷ", "ÿ", "ź", "ż", "ž");
$to = array("A", "A", "A", "A", "A", "A", "A", "A", "A", "AE", "C", "C", "C", "C", "C", "D", "D", "D", "E", "E", "E", "E