Skip to content

Instantly share code, notes, and snippets.

@oglops
oglops / libc_strip.patch
Created September 16, 2015 07:21
keep fchdir symbol in libc.so.0 on tomato shibby v131, so that perpd can run
diff -aur '--exclude=.git' /home/oglop/tomato/tomato_intact/release/src/btools/libfoo.pl /home/oglop/tomato/tomato_latest/release/src/btools/libfoo.pl
--- /home/oglop/tomato/tomato_intact/release/src/btools/libfoo.pl 2015-09-16 11:51:50.750693058 +0800
+++ /home/oglop/tomato/tomato_latest/release/src/btools/libfoo.pl 2015-09-16 15:06:21.243200192 +0800
@@ -493,6 +493,17 @@
# <>;
return 0;
}
+
+ # keep this symbol for libc
+ my @keep_symbols=("fchdir");
@oglops
oglops / .uclibc.0.9.33.config
Created November 30, 2015 08:40
uclibc 0.9.33 config file from buildroot
#
# Automatically generated make config: don't edit
# Version: 0.9.33.2
# Sun Nov 29 23:08:10 2015
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_c6x is not set
@oglops
oglops / .ctng.config
Last active July 14, 2020 10:03
config file for crosstools-ng 1.22 with custom uclibc 0.9.33 config file
#
# Automatically generated file; DO NOT EDIT.
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
CT_MODULES=y
#
# Paths and misc options
@oglops
oglops / rpmrebuild
Last active December 13, 2015 02:46
rpmrebuild script by gcomes https://www.centos.org/forums/viewtopic.php?f=48&t=49542 remove --target i686 if it's not for 32 bit rpm build
#!/bin/bash
EDIT=0
while (($#)) ; do
[[ ${1:0:1} != - ]] && break
case ${1:1} in
e) EDIT=1 ; shift ;;
*) echo "Unknown option $1, ignoring" ; shift ;;
esac
@oglops
oglops / syntax_exmaple.py
Created January 25, 2016 08:58
PyQt4 port of the richtext/syntaxhighlighter example from Qt v4.x
#!/usr/bin/env python
"""PyQt4 port of the richtext/syntaxhighlighter example from Qt v4.x"""
from PyQt4 import QtCore, QtGui
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
@oglops
oglops / editor.py
Created January 25, 2016 09:01
This example was based on existing work by Carson Farmer and Christophe Kibleur, and an example on the SciPres wiki. One aspect not addressed by this prior work is handling of Python's triple-quoted strings, which may span multiple lines; the QSyntaxHighlighter documentation includes an example for C++ comments, but those have different beginnin…
# editor.py
from PyQt4 import QtGui
import syntax
app = QtGui.QApplication([])
editor = QtGui.QPlainTextEdit()
highlight = syntax.PythonHighlighter(editor.document())
editor.show()
@oglops
oglops / setFontSize.py
Last active February 5, 2016 15:40
set maya script editor font size on hidpi laptop screen
from PyQt4 import QtGui,QtCore
from maya import cmds
import maya.OpenMayaUI as apiUI
import sip
ptr = apiUI.MQtUtil.mainWindow()
mwin=sip.wrapinstance(long(ptr), QtCore.QObject)
cmdReporters = cmds.lsUI(type='cmdScrollFieldReporter')
cmdReporter = mwin.findChild(QtGui.QTextEdit, cmdReporters[0])
@oglops
oglops / QAbstractListModel_eg_1.py
Last active February 17, 2016 07:51
QAbstractListModel example 1
#!/usr/bin/env python
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class MyModel(QAbstractListModel):
def __init__(self, parent=None):
@oglops
oglops / QTreeView_with_QStandardItemModel.py
Created February 15, 2016 01:38
QTreeView + QStandardItemModel
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
data = {'level1': ['1', '2', '3'],
'level2': ['4', '5', '6'],
'level3': ['7', '8', '9']}
class Window(QMainWindow):
@oglops
oglops / QTreeView_with_QFileSystemModel.py
Created February 15, 2016 01:39
QTreeView + QFileSystemModel
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Window(QMainWindow):
'This time I try to put the table populating code in main ui'
def __init__(self, parent=None):