Skip to content

Instantly share code, notes, and snippets.

View tru2dagame's full-sized avatar
💭
🏀

Tru tru2dagame

💭
🏀
  • Ubiquiti
  • Shanghai
View GitHub Profile
@rougier
rougier / tag.el
Last active May 29, 2024 15:51
Rounded boxed tags for Emacs
;; ---------------------------------------------------------------------
;; Tag minor mode
;; Copyright (C) 2020 Nicolas .P Rougier
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active January 27, 2026 03:33
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@JoeShi
JoeShi / ecs-log-to-es.js
Created March 6, 2019 09:32
ECS awslogs to Elasticsearch Lambda
// v1.1.2
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = '<elasticsearch-endpoint-in-your-vpc>'; // use elasticsearch in VPC
// Set this to true if you want to debug why data isn't making it to
// your Elasticsearch cluster. This will enable logging of failed items
// to CloudWatch Logs.
@nwade
nwade / README.md
Last active November 14, 2025 04:39
Remove SentinelOne Agent - macOS High Sierra/Mojave

Warning - use at your own risk

Remove SentinelOne agent from Mac

  1. Boot into Recovery Mode by holding Cmd+R during reboot
  2. Open Terminal from top menubar
  3. Run /Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility to open Disk Utility
  4. If your startup disk is encrypted, use Disk Utility to mount it
  5. In Terminal, run chroot /Volumes/Macintosh\ HD
  6. Execute the deletion commands or script
@huevos-y-bacon
huevos-y-bacon / aws_ec2_termination_protection.md
Last active August 7, 2024 10:32
AWS EC2 - Enable or disable EC2 instance "Termination Protection" via AWS CLI (shell)

Loop through all EC2 instances (excluding terminated and spot) and enable termination protection

for I in $(aws ec2 describe-instances --query \
  'Reservations[].Instances[?(InstanceLifecycle!=`spot` && InstanceState!=`terminated`)].[InstanceId]' \
  --output text); do
  aws ec2 modify-instance-attribute --disable-api-termination --instance-id $I;
done
@tru2dagame
tru2dagame / open_file_with_emacsclient.scpt
Last active February 16, 2020 18:23
Use apple script to open the selected file in finder with emacscilent
-- get the file path from the finder
tell application "Finder" to set theItems to selection
set thePaths to ""
repeat with i in theItems
set thisItem to POSIX path of (i as alias)
set thePaths to thePaths & thisItem & return
end repeat
set filePath to thePaths
-- remove \n of the file path
@shijij
shijij / gist:54c9b21f26c08a15a70c182f03cb15b4
Created November 14, 2017 12:31
Nginx ssl reverse proxy with SNI
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain
ssl_certificate /etc/ssl/localcerts/yourdomain.crt;
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key;
ssl_ecdh_curve prime256v1;
ssl_session_cache builtin:1000 shared:SSL:10m;
@ibraheem4
ibraheem4 / postgres-brew.md
Last active September 27, 2025 02:49
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@dbannik
dbannik / zabbix-install.sh
Last active March 29, 2023 13:37
Install zabbix 3.2 for ubuntu 16.04
#!/bin/sh
apt update && apt install wget htop curl nano ssh -y
wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb && apt-get update
export DEBIAN_FRONTEND=noninteractive
apt install zabbix-server-mysql zabbix-frontend-php -y
@daronco
daronco / letsencrypt-webroot-apache.md
Last active February 15, 2024 11:50
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>