Skip to content

Instantly share code, notes, and snippets.

@TheAnonymous
TheAnonymous / delete_unused_latex.sh
Last active December 23, 2015 19:29
This script searches& deletes files that nobody needs execpt LaTex itself. So whe you normally makea PDF with LaTex you have n files laying around which you done need this makes it hard to see the files which are important. This Script searches and deltes them. Watches if md5sum of pdf changed and if yes then deletes files which where prodouced …
#!/bin/bash
while [ 1 ]
do
hash2=$(md5sum `find -iname "*.pdf"`|awk '{print $1}')
sleep 2
hash=$(md5sum `find -iname "*.pdf"`|awk '{print $1}')
if [ $hash2 != $hash ]
then
echo "Delted some unused files"
rm `find -iname "*.aux" -o -iname "*.out" -o -iname "*.fls" -o -iname "*.bbl" -o -iname "*.blg" -o -iname "*.fdb_latexmk" -o -iname "*.lof" -o -iname "*.lot" -o -iname "*.toc"`
@TheAnonymous
TheAnonymous / Bcache Tutorial
Last active April 21, 2019 03:46
Making a SSD working as a Cache for a HDD with bcache.
There are 3 Methods for using a SSD as cache.
dm-cache, bcache,enhance-io all three should be avaliable in Kernel Version 3.10.
Performance differenceses are discussed here => http://lkml.indiana.edu/hypermail/linux/kernel/1306.1/01246.html
In this tutorial I will use bcache since dm-cache didn't worked for me.
At the moment there is only an rc5 candidate for kernel 3.10.0
How to compile it is explained below. If you have a newer kernel than 3.10 and it is bcache enabled you dont need to compile it by yourself. In this case just jump over the kernel-compile-exlanation. If your kernel is compiled with bcache support you can test with "modprobe bcache". If that doesnt throw an error it should work :)
I will link to the tutorials I used. If you found better ones please paste a link in the comments
How to compile a kernel by yourself is explained at:
=> http://bodhizazen.net/Tutorials/kernel
@TheAnonymous
TheAnonymous / set_brightness.sh
Created March 14, 2013 10:38
This script is for Lenovo T400s (may work on others too...) to set the brightness through the console. Tested on Fedora 18. To get the path for your Laptop this command may helps you find /sys -iname *bright*
#!/bin/bash
ab=`cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/actual_brightness`
mb=`cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/max_brightness`
echo "The max brightness is " $mb " your actual brightness is " $ab " please enter your new brightess:"
read cb
echo $cb > "/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness"
git clone git://github.com/mumble-voip/mumble.git mumble
cd mumble
git submodule init
git submodule update
git checkout --track -b master origin/master
qmake CONFIG+=no-server CONFIG+=nog15 CONFIG+=no-bundled-celt CONFIG+=no-upate CONFIG+=static main.pro -recursive
make -j50 //Falls es Fehler gibt nochmal mit "make -j1" posten damit Fehler in richtiger Reihenfolge sind
@TheAnonymous
TheAnonymous / Int2Char
Created November 2, 2010 13:17
Make a int to a const char array pointer
int operator1 = 12;
const gchar * operator1_char = g_strdup_printf("%d", operator1);
//Only tested with compileroption -std=gnu++0x
@TheAnonymous
TheAnonymous / C++ SQLite read
Created November 2, 2010 13:13
How to read a SQLite Database
#include <sqlite3.h>
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int zeile;