Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
mkdir -p /data/mysql /data/redis
# mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -v /data/mysql:/var/lib/mysql -d --restart unless-stopped mysql:5.7 --general-log=1 --general_log_file=general.log
# redis
docker run --name redis -p 6379:6379 -v /data/redis:/data -d --restart unless-stopped redis:4.0-alpine redis-server --appendonly yes
@DaysJan
DaysJan / ProgressBar.php
Last active January 3, 2019 15:16
A simple php script progress bar.
<?php
function progress($done, $total) {
static $width;
static $block = 0;
if (! isset($width)) {
$width = (int) exec('tput cols');
}
@hkoba
hkoba / sched-reboot.service
Last active January 21, 2025 08:12
systemd service and timer for scheduled reboot.
[Unit]
Description=Scheduled Reboot
[Service]
Type=simple
ExecStart=/usr/bin/systemctl --force reboot

Just some notes and references for myself.

  • In bash, you can access your C:\ drive via /mnt/c/
  • ~ = C:\Users\MLM\AppData\Local\lxss\home\mlm and is different from your Windows user directory C:\Users\MLM

How to google things

@tanyuan
tanyuan / smart-caps-lock.md
Last active November 1, 2025 23:13
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@tsolar
tsolar / laravel-subdirectory.conf
Last active September 19, 2025 14:24
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;