Skip to content

Instantly share code, notes, and snippets.

def listStreams(self):
r = "Streams:\n"
c = self.db.cursor()
c.execute('SELECT id, url, type, en, state FROM streams ORDER BY en, id')
for i in c.fetchall():
num = "%05d" % i[0]
if i[3] == 1: en = "+";
else: en = "-"
if i[2] == 1: t = " RSS"
else: t = "PAGE"
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp$ ls
linux-3.0.1 linux-3.0.1.tar.bz2
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp$ cd linux-3.0.1/
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1$ git init
Initialized empty Git repository in /home/mkrentovskiy/tmp/linux-3.0.1/.git/
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1$ time git add .
real 0m24.748s
user 0m20.520s
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1$ cd .hg
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg$ ls
00changelog.i dirstate last-message.txt requires store undo.branch undo.desc undo.dirstate
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg$ cd store
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$ ls
00changelog.d 00changelog.i 00manifest.d 00manifest.i data dh fncache undo
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$ cd data
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store/data$ ls
~2egitignore.i block crypto firmware init _kconfig.i _m_a_i_n_t_a_i_n_e_r_s.i net samples sound virt
@mkrentovskiy
mkrentovskiy / gist:1203371
Created September 8, 2011 13:20
6to2channel-resample.patch
Index: libavcodec/resample.c
===================================================================
--- libavcodec/resample.c (revision 11509)
+++ libavcodec/resample.c (working copy)
@@ -37,6 +37,17 @@
int input_channels, output_channels, filter_channels;
};
+/*
+*/
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
res := make([][]uint8, dx)
for x := range res {
res[x] = make([]uint8, dy)
for y := range res[x] {
sudo apt-get install git-core bison flex g++ gettext texinfo libncurses5-dev pv libssl-dev lzop gawk
git clone git://github.com/virt2real/dm36x-buildroot.git
cd dm36x-buildroot
make virt2real_v1_mass_defconfig
make menuconfig
make
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
@mkrentovskiy
mkrentovskiy / Install LT4 21.1.md
Created January 8, 2016 18:29 — forked from jetsonhacks/Install LT4 21.1.md
Install LT4 21.1 on Jetson TK1

For best results, you should read through the official NVIDIA documentation found on:

https://developer.nvidia.com/linux-tegra-rel-21

In particular, the Quick Start Guide.

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04 is officially recommended. In practice, this may be a virtual machine, I have used VirtualBox in the past. Also, I've successfully flashed from Ubuntu Linux 14.04. Your mileage may vary.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply
@mkrentovskiy
mkrentovskiy / pagespeed_optimize_images.sh
Created December 7, 2019 11:22 — forked from julianxhokaxhiu/pagespeed_optimize_images.sh
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} optipng -nb -nc "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} advpng -z4 "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow "{}"
find . -type f -name "*.jpg" -o -name "*.JPG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"
find . -type f -name "*.jpeg" -o -name "*.JPEG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"