Skip to content

Instantly share code, notes, and snippets.

View liujingyu's full-sized avatar

jingyu liu liujingyu

View GitHub Profile
@liujingyu
liujingyu / pmm-admin.md
Created August 3, 2017 10:35
pmm-admin启动过程及Server添加
pmm-admin config --server 110.31.145.69 --server-user example --server-password example1234 --bind-address 110.45.40.204 --client-address 110.45.40.204 --client-name luka-online


pmm-admin add mysql --user root --password 123456 --host 110.45.40.204 --port 3306 example-3306
@rkaneko
rkaneko / InstallingAgOnCentOS.md
Last active November 7, 2022 16:57
Installing ag: the silver searcher on CentOS.

Installing ag on CentOS

Prerequistes

  • libpcre
  • liblzma

Download, build and install

@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active November 21, 2023 19:48
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@guweigang
guweigang / git_toturial
Last active April 29, 2024 05:56
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@ohaal
ohaal / find_relative_path.func.php
Created June 15, 2012 11:47
Find the relative path between two paths
/**
*
* Find the relative file system path between two file system paths
*
* @param string $frompath Path to start from
* @param string $topath Path we want to end up in
*
* @return string Path leading from $frompath to $topath
*/
function find_relative_path ( $frompath, $topath ) {
@pix0r
pix0r / fabfile.py
Created March 8, 2012 18:49
Sample Fabric environment setup
from fabric.api import env, run
from fabric.contrib.project import rsync_project
try:
from fabfile_local import *
except ImportError, e:
environments = {
"dev": {
"hosts": ["localhost"],
},
@andyfowler
andyfowler / .vimrc
Created September 5, 2011 18:08
Swap iTerm2 cursors in vim insert mode when using tmux
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif