Skip to content

Instantly share code, notes, and snippets.

@fjrti
fjrti / sys-mon.sh
Created August 23, 2013 17:28 — forked from wangyan/sys-mon.sh
#! /bin/bash
#====================================================================
# sys-mon.sh
#
# Copyright (c) 2011, WangYan <webmaster@wangyan.org>
# All rights reserved.
# Distributed under the GNU General Public License, version 3.0.
#
# Monitor system mem and load, if too high, restart some service.
#
/*
CSS stylesheet is based on Kevin Burke's Markdown.css project:
http://kevinburke.bitbucket.org/markdowncss
For code highlighting:
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/magula.min.css">
<script src="http://yandex.st/highlightjs/6.1/highlight.js"></script>
<script src="http://yandex.st/highlightjs/6.1/languages/cpp.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
*/
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: set_rps
# Required-Start: $remote_fs $network $time $syslog
# Required-Stop: $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Set rps
# Description: Script for open rps
/*
** Copyright 2000
** by
** The Board of Trustees of the
** Leland Stanford Junior University.
** All rights reserved.
**
**
** Disclaimer Notice
**
@fjrti
fjrti / crypt.c
Last active August 12, 2021 02:56
crypt加密
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define _XOPEN_SOURCE
int main(void)
{
char *passwd;
char key[] = "123456";
passwd = crypt(key, "$6$y9cP0qlmDYgBk6OZ$");
function! SetCursorStyle()
if &term =~ "xterm\\|rxvt"
" use a | cursor in insert mode
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
" use a rectangle cursor otherwise
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" reset cursor when vim exits
autocmd VimLeave * silent !echo -ne "\<Esc>]50;CursorShape=0\x7"
@fjrti
fjrti / shell_bookmark.sh
Last active March 15, 2019 01:23
bookmark of shell
# USAGE:
# s bookmarkname - saves the curr dir as bookmarkname
# g bookmarkname - jumps to the that bookmark
# g b[TAB] - tab completion is available
# l - list all bookmarks
# save current directory to bookmarks
touch ~/.sdirs
function s {
cat ~/.sdirs | grep -v "export DIR_$1=" > ~/.sdirs1
https://github.com/git/git/tree/e83c5163316f89bfbde7d9ab23ca2e25604af290
@fjrti
fjrti / chrome_patch_for_Surfingkeys.diff
Last active March 16, 2019 17:32
Surfingkeys support in Chrome reserved page
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index f637193e644f..60f9f5cd3644 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -147,6 +147,10 @@ void NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(
->GetController()
->GetBrowserContext(),
url);
+ bool whitelistedSurfingkeys = url.host() == "gfbliohnnapiefjpjlpjnehglfpaknnc";
+ if (whitelistedSurfingkeys) {
@fjrti
fjrti / 256-color.sh
Last active March 15, 2019 01:21
256-color
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256