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 / vhost.txt
Created August 21, 2019 19:29
Socket.io via Apache Reverse Proxy
<VirtualHost *:80>
ServerName example.com
ServerAlias example.com www.example.com
ServerAdmin admin@example.com
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://example.com/$1 [NC,R,L]
</VirtualHost>
@skorotkiewicz
skorotkiewicz / reverseWords.js
Created July 23, 2019 17:55 — forked from willread/reverseWords.js
Reverse the words in a string
// Reverse words in a string
var reverseWords = function(sentence){
var words = sentence.split(" ").reverse(); // Split the sentence into an array of words and reverse it
var string = "";
for(word in words)
string += (word > 0 ? " " : "") + words[word]; // Concatenate each word to the output and add spaces where required
return string;
package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3"
)
type Users struct {
Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"`

Trying to deploy WPA3 on my home network

Introduction

Recently, news broke about a new possible offline attack on WPA2 using PMKID. To summarize the attack, WPA2 protected APs can end up broadcasting PMKID values which can then be used to offline-brute-force the password.

These PMKID values are computed this way:

PMKID = HMAC-SHA1-128(PMK, "PMK Name" | MAC_AP | MAC_STA)
@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