Skip to content

Instantly share code, notes, and snippets.

View Leo1003's full-sized avatar

Shao-Fu Chen Leo1003

  • Taipei
  • 16:21 (UTC +08:00)
View GitHub Profile
@labrown
labrown / elasticsearch-handlers-main.yml
Last active September 22, 2023 12:11
Ansible rolling restart of Elasticsearch Cluster
---
###
# Elasticsearch Rolling restart using Ansible
###
##
## Why is this needed?
##
#
# Even if you use a serial setting to limit the number of nodes processed at one
@Explorer09
Explorer09 / ntfs_attr.sh
Last active July 5, 2024 06:34
Display or change attributes on an NTFS filesystem
#!/bin/sh
# ntfs_attr.sh - Display or change attributes on an NTFS filesystem
# Tools required:
# getfattr(1) and setfattr(1)
# http://savannah.nongnu.org/projects/attr/
# (In Debian/Ubuntu: sudo apt-get install attr)
# ntfs-3g (pre-installed in most Linux distros)
# http://www.tuxera.com/community/ntfs-3g-download/
@MightyPork
MightyPork / usb_hid_keys.h
Last active July 18, 2024 08:20
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@Robbepop
Robbepop / .rustfmt.toml
Created March 16, 2017 18:19
.rustfmt.toml with all configs, descriptions, parameters and defaults for version 0.7.1 of rustfmt.
# ----------------------------------------------------------------------------------
# r u s t f m t - C O N F I G
# ==================================================================================
#
# Version: 0.7.1
# Author : Robbepop <robbepop@web.de>
#
# A predefined .rustfmt.toml file with all configuration options and their
# associated description, possible values and default values for use in other
# projects.
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active July 1, 2024 21:55
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@tsuchm
tsuchm / ldapsearch.sh
Created December 10, 2019 00:18
ldapsearch with Base64 decode
#!/bin/sh
/usr/bin/ldapsearch -o ldif-wrap=no "$@" | perl -MMIME::Base64 -Mutf8 -pe 's/^([-a-zA-Z0-9;]+):(:\s+)(\S+)$/$1.$2.&decode_base64($3)/e'