Skip to content

Instantly share code, notes, and snippets.

View dammyammy's full-sized avatar

Dammy O dammyammy

View GitHub Profile
@dammyammy
dammyammy / cm-index-fix.js
Last active December 15, 2021 23:43
Fix That moves the arrays by value
const blocks = [
{
"id":"GZ9oeIry1l",
"type":"outlineTopic",
"data":{
"text":"Section 1",
"level":4,
"metadata":{
"id":"f39bfcf5-98e6-47da-a214-84d8d1ac27c7"
}
@dammyammy
dammyammy / vpnclient
Created June 12, 2020 15:55 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.
#############################
### GENERATE CERT AND KEY ###
#############################
# when generating key and cert, use password provided by administrator
cd ~/Workspace/Silvermedia/vpn
kozak127@callisto:~/Workspace/Silvermedia/vpn$ openssl pkcs12 -in michal.wesoly.p12 -nocerts -nodes -out michal.wesoly.key
Enter Import Password:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y
apt-get -y install build-essential wget curl gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev zlib1g-dev
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.34-9745-beta/softether-vpnserver-v4.34-9745-beta-2020.04.05-linux-x64-64bit.tar.gz
tar xzf softether-vpnserver-v4.34-9745-beta-2020.04.05-linux-x64-64bit.tar.gz && rm softether-vpnserver-v4.34-9745-beta-2020.04.05-linux-x64-64bit.tar.gz
cd vpnserver && sudo make
cd ..
sudo mv vpnserver /usr/local && cd /usr/local/vpnserver/
sudo chmod 600 *
@dammyammy
dammyammy / setup-docker-dev-containers.sh
Last active July 23, 2021 01:13
Setup Docker Containers for local development
docker network create --driver=bridge localnet
docker run --name metabase -p 3333:3000 --network localnet -v metabase_data:/metabase-data -e MB_DB_FILE=/metabase-data/metabase.db -e MUID=$UID -e MGID=$GID -d metabase/metabase
docker run --name mysql57 -p 3307:3306 --network localnet -v mysql_data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=openseseme -d mysql/mysql-server:5.7
docker run --name mysql8 -p 3308:3306 --network localnet -v mysql8_data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=openseseme -d mysql/mysql-server
docker run --name redis -p 6379:6379 --network localnet -v redis_data:/data -v redis_logs:/logs -d redis --appendonly yes
@dammyammy
dammyammy / convert-to-ssh.sh
Created April 4, 2019 19:12 — forked from bhagyas/convert-to-ssh.sh
Convert BitBucket HTTPS to SSH
#/bin/bash
#-- Author: Bhagya Silva (https://about.me/bhagyas)
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
#-- based on original code from : https://gist.github.com/m14t/3056747
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
@dammyammy
dammyammy / ActiveLink.js
Created November 29, 2018 12:24 — forked from remy/ActiveLink.js
Next.js version of `activeClassName` support.
@dammyammy
dammyammy / store.js
Created July 27, 2018 01:53
Simple Vuex Implementation
import Axios from 'axios'
state = {
todos : null
},
getters = {
TODOS : state => {
return state.todos;
}
},
@dammyammy
dammyammy / sendy.nginxconf
Created March 13, 2018 14:57 — forked from nathanielvarona/sendy.nginxconf
Sendy NGINX Configuration works with Sendy 2 and NGINX 1.8 https://sendy.co/
server {
#listen 80;
#listen [::]:80;
server_name sub.domain.tld;
access_log /var/log/sendy/nginx.access.log;
error_log /var/log/sendy/nginx.error.log;
@dammyammy
dammyammy / .htaccess
Created February 14, 2018 01:19
Laravel Optimal HTACCESS FILE
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
RewriteEngine On