Skip to content

Instantly share code, notes, and snippets.

View Gnnng's full-sized avatar
🎯
Focusing

Deli Gong Gnnng

🎯
Focusing
View GitHub Profile
@Gnnng
Gnnng / adduser.sh
Created December 14, 2019 08:13
Create new user with sudo permission and github keys imported
#!/bin/bash
name=$1
gh_name=$2
sudo adduser --gecos "" --disabled-password ${name}
sudo adduser "${name}" sudo
sudo runuser - "${name}" ssh-import-id-gh "${gh_name}"
@Gnnng
Gnnng / openfortivpn.1s.sh
Last active March 17, 2018 15:27
Bitbar plugin for start/stop openfortivpn (brew service)
#!/bin/bash
sudo=/usr/bin/sudo
brew=/usr/local/bin/brew
icon_off='iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABYlAAAWJQFJUiTwAAACZmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MzY8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MzY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJE
@Gnnng
Gnnng / autossh-template.service
Created October 26, 2017 08:42
A systemd service template for reverse proxy using autossh
[Unit]
Description=autossh daemon for remote-server
After=network.target
[Service]
User=gongdeli
ExecStart=/usr/bin/autossh -NR 62222:localhost:2222 remote-server
Restart=always
RestartSec=10
@Gnnng
Gnnng / Nexys3_master.ucf
Created April 20, 2015 09:56
ucf file of Nexys3
## This file is a general .ucf for Nexys3 rev B board
## To use it in a project:
## - remove or comment the lines corresponding to unused pins
## - rename the used signals according to the project
##Clock signal
#Net "clk" LOC=V10 | IOSTANDARD=LVCMOS33;
#Net "clk" TNM_NET = sys_clk_pin;
#TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 100000 kHz;