Skip to content

Instantly share code, notes, and snippets.

View xuxiaodong's full-sized avatar

Xiaodong Xu xuxiaodong

View GitHub Profile
@xuxiaodong
xuxiaodong / OVERLAYFS
Created January 14, 2022 06:16 — forked from mutability/OVERLAYFS
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@xuxiaodong
xuxiaodong / rmd.md
Last active September 22, 2021 06:19

R Markdown

内建

  • HTML (使用 Bootstrap CSS)
  • PDF (通过 LaTeX 模板)
  • Word (docx)
  • ODT (OpenDocument Text)
  • RTF (Rich Text Format)
  • Markdown
@xuxiaodong
xuxiaodong / config
Last active October 29, 2020 00:34
Sway config
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
@xuxiaodong
xuxiaodong / keybase.md
Created January 18, 2017 06:34
keybase

Keybase proof

I hereby claim:

  • I am xuxiaodong on github.
  • I am xuxiaodong (https://keybase.io/xuxiaodong) on keybase.
  • I have a public key whose fingerprint is 268F C857 2AAE A1C4 314C 89BF FF78 49F9 9CD3 70EA

To claim this, I am signing this object:

@xuxiaodong
xuxiaodong / ruby2.0.0-p0.readline.diff
Created April 14, 2014 01:48
ruby2.0.0-p0.readline.diff
--- ext/readline/readline.c 2013-02-01 05:37:29.000000000 +0000
+++ ext.n/readline/readline.c 2014-04-14 01:31:47.000000000 +0000
@@ -1883,7 +1883,7 @@
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
---
# This playbook deploys the AWX application (database, web and worker) to a
# single server.
- hosts: all
tasks:
- name: group hosts by distribution
group_by: key="{{ ansible_distribution }}-{{ ansible_distribution_version }}"
- hosts: RedHat-6*:CentOS-6*:SL-6*
---
- name: create rsyslog.d directory
file: path=/etc/rsyslog.d state=directory
- name: deploy config file for rsyslogd
copy: src=51-awx.conf dest=/etc/rsyslog.d/51-awx.conf
notify: restart rsyslogd
tags:
- misc
---
# Tasks for configuring PostgreSQL server.
#- name: init postgresql
# command: service postgresql initdb creates=/var/lib/pgsql/data/PG_VERSION
# when: ansible_distribution != "Ubuntu"
# tags: postgresql
- name: update postgresql authentication settings
template: src=pg_hba.conf.j2 dest={{pg_hba_location}} owner=postgres
---
# Tasks to install required packages for awx
#- name: install ubuntu awx apt repository
# template: src=awx_repo.j2 dest=/etc/apt/sources.list.d/awx_repo.list
- name: install python-pip package for ubuntu 12.04
apt: name=python-pip
when: ansible_lsb.codename == "precise"
extends perl
## ROUTE DEFINITIONS
snippet get "GET route" !b
get '/${1}' => sub {
${2:${VISUAL:...;}}
};
endsnippet