Skip to content

Instantly share code, notes, and snippets.

@ivoronin
ivoronin / create_gitlab_token.rb
Created November 22, 2019 19:45
Create GitLab Personal Access Token from cli
#
# gitlab-rails runner -e production create_gitlab_token.rb <token name> <token>
#
def update_token(token, desired_name, desired_scopes, desired_token_digest)
token.name = desired_name
token.scopes = desired_scopes
token.name = desired_name
token.scopes = desired_scopes
token.token_digest = desired_token_digest
token.revoked = false
#!/usr/bin/env python
#
# Usage: ./pgpoke.py <dsn>
#
import psycopg2
from sys import argv
from time import sleep
from datetime import datetime
import logging
@ivoronin
ivoronin / qmi_dissector.lua
Created May 9, 2012 03:26
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol
--[[
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol v0.1
Copyright (c) 2012 Ilya Voronin <ivoronin@gmail.com>
Based on Code Aurora Forum's BSD/GPL licensed code:
http://www.codeaurora.org/contribute/projects/gobi/
Short howto for using this script:
@ivoronin
ivoronin / PKGBUILD
Created August 4, 2012 22:24
systemtap pkgbuild
# Maintainer: Sebastien Binet <binet@farnsworth>
# Wu Xingbo <wuxb45@gmail.com>
pkgname=systemtap
pkgver=1.8
pkgrel=1
pkgdesc="SystemTap provides free software (GPL) infrastructure to simplify the gathering of information about the running Linux system."
url="http://sourceware.org/systemtap/"
arch=('i686' 'x86_64')
license=('GPL')
@ivoronin
ivoronin / linux-systemtap.patch
Created August 6, 2012 06:17
core/linux PKGBUILD patch for building debuginfo package
diff -ur linux.orig/PKGBUILD linux/PKGBUILD
--- linux.orig/PKGBUILD 2012-08-28 21:53:04.757568936 +0400
+++ linux/PKGBUILD 2012-08-28 22:05:23.470891452 +0400
@@ -24,8 +24,8 @@
'i915-i2c-crash-3.5.x.patch')
md5sums=('24153eaaa81dedc9481ada8cd9c3b83d'
'01e0536109d2a06b1701b5051edfcea2'
- '4eb50449b069bd699d92a290dce76d00'
- '74c0ce9291ad8aaf26546fe85a1a7d18'
+ 'f2abe8d7f67936cc0cc8fc50a8d5dcf0'
@ivoronin
ivoronin / StraceLexer.py
Created November 10, 2012 19:29
strace lexer for pygments
__author__ = 'ivoronin'
from pygments.lexer import RegexLexer, bygroups, include
from pygments.token import *
class StraceLexer(RegexLexer):
name = "Strace"
aliases = ["strace", "truss"]
tokens = {
'generic': [
from twisted.web import proxy, server
import StringIO
import re
from urllib import quote as urlquote
from twisted.application import service, internet
class XMLSTRFixingProxy(proxy.ReverseProxyResource):
def getChild(self, path, request):
return XMLSTRFixingProxy(
self.host, self.port,
# vi: ft=diff
Screen titles patch
Index: mutt-1.5.21/curs_main.c
===================================================================
--- mutt-1.5.21.orig/curs_main.c 2012-04-11 19:41:49.898788540 +0400
+++ mutt-1.5.21/curs_main.c 2012-04-11 19:44:32.826795297 +0400
@@ -123,6 +123,11 @@
fprintf(stderr, "%c]1;%s%c", ASCII_CTRL_OPEN_SQUARE_BRAKET, name, ASCII_CTRL_G);
}
@ivoronin
ivoronin / qmi_wwan.patch
Created May 21, 2012 11:32
qmi_wwan patch
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -365,6 +365,24 @@ static const struct driver_info qmi_wwan_force_int4 = {
.data = BIT(4), /* interface whitelist bitmap */
};
+static const struct driver_info qmi_wwan_force_int2 = {
+ .description = "Qualcomm Gobi wwan/QMI device",
+ .flags = FLAG_WWAN,
+ .bind = qmi_wwan_bind_gobi,
@ivoronin
ivoronin / option.patch
Created May 21, 2012 11:47
option patch
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -164,6 +164,8 @@ static void option_instat_callback(struct urb *urb);
#define QUANTA_PRODUCT_GLX 0xEA04
#define QUANTA_PRODUCT_GKE 0xEA05
#define QUANTA_PRODUCT_GLE 0xEA06
+#define QUANTA_PRODUCT_YOTA_ROUTER_OLD 0xD00A
+#define QUANTA_PRODUCT_YOTA_ROUTER 0xD009
#define NOVATELWIRELESS_VENDOR_ID 0x1410