Skip to content

Instantly share code, notes, and snippets.

View kanru's full-sized avatar

Kan-Ru Chen kanru

View GitHub Profile
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index daeb8f7..48e67b3 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2523,6 +2523,9 @@ int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
rpgrp = get_pid(real_tty->pgrp);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ tty->winsize = *ws;
+ real_tty->winsize = *ws;
Index: plugins_base/Logger.py
===================================================================
--- plugins_base/Logger.py (revision 1466)
+++ plugins_base/Logger.py (working copy)
@@ -49,7 +49,7 @@
or similar'''
CREATE_USER = '''
- CREATE TABLE user
+ CREATE TABLE IF NOT EXISTS user
screen 0
{
styles
{
normal
{
font = "sans 8"
fg = "#dddddd"
bg = "#444444"
border = "#555555"
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 7501310..d529bb9 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3021,6 +3021,11 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *re
rpgrp = get_pid(real_tty->pgrp);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ /* NOTE: This isn't really fix the problem, just lower the probability
+ * it occured */
--- flint_database.cc 2009-12-08 13:34:24.790284881 +0800
+++ flint_database.cc 2009-12-10 14:22:14.493653956 +0800
@@ -1188,7 +1188,7 @@
termlist.next();
while (!termlist.at_end()) {
- string tname = termlist.get_termname();
+ string tname = termlist.get_termname();
position_table.delete_positionlist(did, tname);
termcount wdf = termlist.get_wdf();
@kanru
kanru / karma 100
Created February 8, 2010 07:47 — forked from c9s/gist:297919
#karma{color:rgba(0,0,0,0);background:url(http://omploader.org/vM2hoeQ/karma_hack.png) no-repeat;}
@kanru
kanru / Android.mk
Created January 6, 2012 04:16
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@kanru
kanru / repl.js
Created January 10, 2012 09:13
JS repl
const repl = "JS> ";
(function Repl() {
let output;
let reader = {
onInputStreamReady : function(input) {
var sin = Cc['@mozilla.org/scriptableinputstream;1']
.createInstance(Ci.nsIScriptableInputStream);
sin.init(input);
try {
@kanru
kanru / pdf-ocr.sh
Created January 19, 2012 08:19
PDF OCR
#! /bin/sh
# Batch OCR pdf files to text files
#
# Copyright (C) 2012 Kan-Ru Chen <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@kanru
kanru / grep-id
Created February 9, 2012 08:57
grep-id
#! /bin/sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This program uses id-utils[1] output as a hint for grep to quickly
# find the target term. Thus to use this program you have to create
# the ID database first.
#