Skip to content

Instantly share code, notes, and snippets.

View kanguki's full-sized avatar
😘
love ya

Mo Nguyen kanguki

😘
love ya
View GitHub Profile
@kanguki
kanguki / client.go
Created October 15, 2021 00:54 — forked from jordanorelli/client.go
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {
@kanguki
kanguki / node_nginx_ssl.md
Created December 4, 2021 02:32 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@kanguki
kanguki / 20211210-TLP-WHITE_LOG4J.md
Created December 19, 2021 04:54 — forked from SwitHak/20211210-TLP-WHITE_LOG4J.md
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-18 0018 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@kanguki
kanguki / limitmem.sh
Created December 26, 2021 12:59 — forked from vgallet/limitmem.sh
#!/bin/sh
# strict mode: error if commands fail or if unset variables are used
set -eu
if [ "$#" -lt 2 ]
then
echo Usage: `basename $0` "<limit> <command>..."
echo or: `basename $0` "<memlimit> -s <swaplimit> <command>..."
exit 1
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
@kanguki
kanguki / nc_tar_pipe.sh
Created March 3, 2022 02:51 — forked from dwallraff/nc_tar_pipe.sh
Netcat Tar Pipe
## -z is optional. Traffic sent will be less, but CPU overhead will be higher.
# On the receiving end do:
nc -vl 12345 | tar xzv
# And on the sending end do:
tar czvf - * | nc -v <remote_host> 12345
@kanguki
kanguki / graph.go
Last active March 9, 2022 03:59
graph in which vertex store distance from it to other nodes
package main
import (
"fmt"
"math"
)
type NodeId string
type Graph struct {
nodes map[NodeId]*Node
@kanguki
kanguki / log.go
Created April 5, 2022 02:27
Logging enable write log to file, log rotation and debug flag
package log
import (
"flag"
"fmt"
"log"
"os"
"gopkg.in/natefinch/lumberjack.v2"
)
@kanguki
kanguki / treeTraversal.go
Created April 23, 2022 10:26
tree traversal in go (recursively)
package main
import (
"fmt"
)
type TreeNode struct {
Val int
Left *TreeNode
Right *TreeNode
@kanguki
kanguki / gitconfig
Last active September 3, 2022 10:31
~/.ssh/config and ~/.gitconfig to work with multiple github accounts in one machine. you're welcome~~~
[url "git@private1.github.com:someuser/private-repo-1"]
insteadOf = https://github.com/someuser/private-repo-1
[url "git@private2.github.com:someuser/private-repo-2"]
insteadOf = https://github.com/someuser/private-repo-2
[url "git@customName.github.com:keepThis"]
insteadOf = git@github.com:keepThis