Skip to content

Instantly share code, notes, and snippets.

View ftfniqpl's full-sized avatar

ftfniqpl

  • shenzhen
View GitHub Profile
@ftfniqpl
ftfniqpl / readydedis.com.conf
Created October 22, 2021 06:35 — forked from Bharat-B/readydedis.com.conf
nGINX rewrite rules for whmcs 8
server {
listen 80 default_server;
server_name readydedis.com www.readydedis.com;
return 301 https://readydedis.com$request_uri;
}
# HTTPS server
#
server {
listen 443;
@ftfniqpl
ftfniqpl / tornado+jinja2
Created December 6, 2017 09:18
tornado4.5+jinja2
#!/usr/bin/env python
#-*-coding:utf-8 -*-
#
#Author: tony - birdaccp at gmail.com
#Create by:2015-01-06 16:31:10
#Last modified:2015-01-06 16:50:27
#Filename:app.py
#Description:
@ftfniqpl
ftfniqpl / sanic_aiomysql_sqlalchemy_demo
Created June 23, 2017 03:31
sanic_aiomysql_sqlalchemy_demo
#!/usr/bin/env python
#-*-coding:utf-8 -*-
#
#Author: tony - birdaccp at gmail.com
#Create by:2017-06-19 10:28:40
#Last modified:2017-06-23 11:30:07
#Filename:demo1.py
#Description:
from aiomysql.sa import create_engine
@ftfniqpl
ftfniqpl / ubuntu16.04 disabled user login
Last active June 23, 2017 03:31
ubuntu16.04 disabled user login
If your system uses `AccountsService`, you *can not* hide a user from the greeter screen by reconfiguring `lightdm`
because it defers to `AccountsService`. That is stated very clearly in the comments in `/etc/lightdm/users.conf`.
What you need to do instead is to reconfigure `AccountsService`.
To hide a user named `XXX`, create a file named
`/var/lib/AccountsService/users/XXX`
containing two lines:
@ftfniqpl
ftfniqpl / Enabling L2TP over IPSec on Ubuntu 16.04
Created June 21, 2017 08:10
Enabling L2TP over IPSec on Ubuntu 16.04
sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
sudo apt update
sudo apt install network-manager-l2tp
@ftfniqpl
ftfniqpl / rebuild vim add python3 support in ubuntu1404
Created June 19, 2017 03:23
rebuild vim add python3 support in ubuntu1404
vim --version | grep python
sudo apt-add-repository ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install vim
sudo pip3 install jedi
1.docker中安装gitlab
1.1 下载镜像
docker pull sameersbn/gitlab:7.11.2 # 下载gitlab镜像
docker pull sameersbn/mysql:latest # 下载gitlab所用到的mysql镜像
docker pull sameersbn/redis:latest # 下载gitlab所用到的redis镜像
1.2 启动redis
docker run --name=gitlab_redis -tid sameersbn/redis:latest
1.3 启动mysql
1.3.1 在宿主机上创建目录 mkdir -p /opt/mysql/data #之后所有的mysql数据库文件都存放在此
1.3.2 启动mysql
@ftfniqpl
ftfniqpl / 使用xrdp实现Windows 远程桌面 Ubuntu Linux
Created July 26, 2016 01:46
使用xrdp实现Windows 远程桌面 Ubuntu Linux
xrdp安装配置方法
打开终端:依次安装
sudo apt-get install xrdp
sudo apt-get install vnc4server tightvncserver
设置xrdp
echo "gnome-session --session=gnome-classic" > ~/.xsession
该命令的作用是由于安装了 gnome桌面,ubuntu12.04中同时存在unity、GNOME多个桌面管理器,需要启动的时候指定一个,不然即使远程登录验证成功以后,也只是背景。
xrdp的配置文档在/etc/xrdp目录下的xrdp.ini和sesman.in,一般选择默认。
重启 xrdp
sudo /etc/init.d/xrdp restart
@ftfniqpl
ftfniqpl / ubuntu14.04连接android手机不能MTP的解决方法
Created May 20, 2016 02:57
ubuntu14.04连接android手机不能MTP的解决方法
sudo apt-get install libmtp-common mtp-tools libmtp-dev libmtp-runtime libmtp9
sudo vim /etc/fuse.conf
将user_allow_other选项开启
lsusb查看设备型号
Bus 002 Device 003: ID 0fce:01b1 Sony Ericsson Mobile Communications AB
sudo vim /lib/udev/rules.d/69-mtp.rules
add this code:
ATTR{idVendor}=="0fce", ATTR{idProduct}=="01b1", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
@ftfniqpl
ftfniqpl / linux shell中显示git的branch
Last active November 6, 2015 02:58
linux shell中显示git的branch
在~/.bashrc最后面增加如下
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo "($branch)"
fi