Skip to content

Instantly share code, notes, and snippets.

View ljjjustin's full-sized avatar

Jiajun Liu ljjjustin

View GitHub Profile
@ljjjustin
ljjjustin / README.md
Created May 21, 2022 15:06 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@ljjjustin
ljjjustin / mkpasswd.py
Created May 11, 2022 08:14 — forked from lorin/mkpasswd.py
Generate a password hash suitable for /etc/shadow. Warning: Gives incorrect value on OS X.
#!/usr/bin/env python
"""
Generate a password hash, suitable for /etc/shadow
Inspired by this code from OpenStack:
https://github.com/openstack/nova/blob/stable/grizzly/nova/virt/disk/api.py#L549
Usage:
mkpasswd <passwd> [--algo=<hash>]
@ljjjustin
ljjjustin / README-setup-socket-activated-systemd-service.md
Created December 18, 2019 14:23 — forked from drmalex07/README-setup-socket-activated-systemd-service.md
An example inetd-like socket-activated service. #systemd #inetd #systemd.socket

README

This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.

Define a socket unit

The key point here is to specify Accept=yes, which will make the socket accept connections (behaving like inetd) and pass only the resulting connection socket to the service handler.

@ljjjustin
ljjjustin / _INSTALL.md
Created October 15, 2019 07:23 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@ljjjustin
ljjjustin / nginx.conf
Created August 30, 2017 13:56 — forked from dctrwatson/nginx.conf
Caching NPM proxy using Nginx
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@ljjjustin
ljjjustin / README.md
Created July 11, 2017 06:19 — forked from andyshinn/README.md
pbcopy over SSH

Install

  • Add pbcopy.plist to your ~/Library/LaunchAgents/ folder.
  • Launch the listener with launchctl load ~/Library/LaunchAgents/pbcopy.plist.
  • Add RemoteForward 2224 127.0.0.1:2224 in your ~/.ssh/config file under your Host * or specific hosts sections.
  • Add [ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224" to your remote ~/.bash_profile or other shell profile.
  • Enjoy pbcopy remotely!