Skip to content

Instantly share code, notes, and snippets.

@raiden2012
raiden2012 / bryton-410-fit-amender.py
Created June 5, 2021 15:17 — forked from yuanying/bryton-410-fit-amender.py
Fix fit file for Bryton Rider 410
#!/usr/bin/python
#
# Fit to TCX
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
@raiden2012
raiden2012 / OpenSSH 安全配置备忘
Created March 2, 2016 07:49
The hand book of OpenSSH configuration
下面是基于 Ubuntu Server 14.04 的 OpenSSH 配置说明,其他发行版的应该是类似的
默认 ubuntu 是没有安装 openssh-server 的,首先安装 sudo apt-get install openssh-server
安装好以后就自动启动了,此时默认运行的端口在 22,简单的话通过 ssh {user}@{host} 的方法就能远程访问了,当然为了保证安全性,建议做两件事,一是将默认端口改掉,二是只允许通过密钥连接,禁止输入用户名密码直接登录
在服务器修改上面2点的配置以前,我们可以先在客户端执行 ssh-keygen,根据具体的提示生成 RSA 的密钥对,最简单的就是一路回车
将生成的公钥 id_rsa.pub 放到服务器需要登录的用户验证文件中,一般为 /home/{user}/.ssh/authorized_keys,可以将内容 cat id_rsa.pub >> authorized_keys,或者直接在客户端中执行 ssh-copy-id -i id_rsa.pub {user}@{host},在默认的配置下客户端自动在服务器上生成相应的文件,记得客户端保留好私钥
@raiden2012
raiden2012 / one line editor
Created February 2, 2015 03:51
one line code to turn browser into an editor
#http://blog.jobbole.com/32823/
data:text/html, <html contenteditable>
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>
@raiden2012
raiden2012 / rename
Last active August 29, 2015 14:06
Change multi files content and names
grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g'
rename foo bar filename
syntax on
filetype indent plugin on
set ruler
set showcmd
set number
set backspace=eol,indent,start
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
set modeline
autocmd FileType python setlocal et sta sw=2 sts=2