unnamed file

Text

No Description

cd ~
sudo apt-get remove hotot
sudo apt-get build-dep -y hotot
sudo apt-get -y install git
git clone https://github.com/ManiacTwister/Hotot.git
cd Hotot && git checkout search_api
mkdir build && cd build
cmake ..
make
sudo make install

unnamed file

Text

hotot quick fix

sudo su
cd /usr/share/hotot/
wget -N https://raw.github.com/ManiacTwister/Hotot/501c55e4455dac3dbed6b413cfe969428743a61a/data/index.html
cd js
wget -N https://raw.github.com/ManiacTwister/Hotot/501c55e4455dac3dbed6b413cfe969428743a61a/data/js/conf.js
wget -N https://raw.github.com/ManiacTwister/Hotot/501c55e4455dac3dbed6b413cfe969428743a61a/data/js/lib.twitter.js
wget -N https://raw.github.com/ManiacTwister/Hotot/501c55e4455dac3dbed6b413cfe969428743a61a/data/js/ui.prefs_dlg.js

unnamed file

C/C++

No Description

Foo *baz;
// Die folgenden drei Zeilen sollten dasselbe tun wie: baz = new Foo[10];
baz = (Foo*)((size_t*)operator new[](10*sizeof(Foo)+sizeof(size_t))+1);
*((size_t*)baz-1) = 10;
for(int i=0; i<10; ++i) new (baz+i) Foo;
delete[] baz;
cout << endl;

unnamed file

C/C++

No Description

Foo *box;
box = (Foo*)malloc(10*sizeof(Foo));
// Für jeden Konstruktor einen individuellen Parameter:
for(int i=0; i<10; ++i) new (box+i) Foo(i*2+1);
cout << endl;
for(int i=0; i<10; ++i) box[i].~Foo();
free(box);
cout << endl;

unnamed file

C/C++

No Description

Ziehung::Ziehung() {
// Ziehung durchfuehren
for(int i=0; i<6; ++i) {
int j; unsigned int z = 1+rand()%(49-i);
for(j=0; j<i && zahlen[j] <= z; ++j, ++z);
for(int k=i; k>j; --k) zahlen[k] = zahlen[k-1];
zahlen[j] = z;
}
superzahl = rand()%10;
}

unnamed file

SH

kgdb misc help

Trigger breakpoint:
echo g > /proc/sysrq-trigger
Module debugging:
modprobe <module>
/root/debugmodule.sh <module>
Run output in gdb. Path to .ko file must match path where the modules are stored on the gdb CLIENT machine.

unnamed file

Text

No Description

root@xubuntu:~# gdb /vmlinux
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...

unnamed file

Text

No Description

In file included from drivers/usb/host/ohci-hcd.c:861:
drivers/usb/host/ohci-pci.c: In function 'ohci_pci_start':
drivers/usb/host/ohci-pci.c:174: error: parse error before 'else'
drivers/usb/host/ohci-pci.c:178: error: 'temp' undeclared (first use in this function)
drivers/usb/host/ohci-pci.c:178: error: (Each undeclared identifier is reported only once
drivers/usb/host/ohci-pci.c:178: error: for each function it appears in.)
drivers/usb/host/ohci-pci.c:189: error: 'pdev' undeclared (first use in this function)
drivers/usb/host/ohci-pci.c:168: warning: unused variable 'ret'
drivers/usb/host/ohci-pci.c: At top level:
drivers/usb/host/ohci-pci.c:194: warning: type defaults to 'int' in declaration of 'ret'

unnamed file

Ruby

timediff

#!/usr/bin/ruby -w
require "time"
def time_diff(time1_str, time2_str)
t = Time.at( Time.parse(time2_str) - Time.parse(time1_str) )
t = (t - t.gmt_offset).strftime("%H:%M:%S")
puts t
end

unnamed file

SH

convert_tv

#!/bin/bash
## Little helper to convert recordings.
## Requires (in $PATH as timediff): http://paste.maniactwister.de/show/2082
show_usage() {
printf "Usage: %s <start hh:mm:ss> <end hh:mm:ss> <inputfile>\n" "$0"
}
if [ $# -lt 2 ]; then
show_usage