Hodžův blog

Archive for the 'Scriptíky' Category

23 Led

MySQL – Remove Duplicate Data or Rows

DELETE FROM mytable USING mytable, mytable as virtualtable WHERE (NOT mytable.id=virtualtable.id) AND (mytable.fieldname=virtualtable.fieldname) Simple isn’t it?

06 Říj

Změna kódování databáze a tabulky u MySQL

ALTER DATABASE `název_databáze` CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `název_tabulky` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; Hint: mysql> show character set;

21 Čvc

Autorádio Blaukpunkt VW Alfa a hláška Safe (aneb jak jsem hackoval autorádio)

Moje žena dostala společně s autem originální autorádio VW alpha (=> Blaukpunkt 815, VWZ1Z1Y9174547, 6X0 035 153). Autorádio dlouho a bez problému sloužilo než bylo nahrazeno jiným (s linkovým vstupem, podporou USB,…). Staré rádio jsem ale nechtěl vyhazovat – bylo opravdu bezproblémové a předpokládal jsem, že by ještě někomu mohlo udělat radost (i když již […]

09 Čvc

TCPdump and ICMP Echo Reply

# tcpdump ‚icmp[icmptype] = icmp-echo‘

14 Kvě

HowTo: Debian & Ubuntu – Remove all unused kernels

sudo apt-get remove $(dpkg -l|egrep ‚^ii linux-(im|he)’|awk ‚{print $2}’|grep -v `uname -r`)

28 Dub

Ubuntu update && Qutim crashes every time

What console says: hodza@hodza-desktop:~$ qutim !!!!!!! ‚kde-plasma‘ ‚0x7f2c933977c0‘ ‚oxygen‘ (qutim:9554): GLib-GObject-WARNING **: cannot register existing type ‚GstObject‘ (qutim:9554): GLib-CRITICAL **: g_once_init_leave: assertion ‚result != 0‘ failed (qutim:9554): GLib-GObject-CRITICAL **: g_type_register_static: assertion ‚parent_type > 0‘ failed (qutim:9554): GLib-CRITICAL **: g_once_init_leave: assertion ‚result != 0‘ failed (qutim:9554): GLib-GObject-CRITICAL **: g_object_newv: assertion ‚G_TYPE_IS_OBJECT (object_type)‘ failed (qutim:9554): GStreamer-CRITICAL **: […]

17 Dub

HowTo: Mounting a image file made with dd or dd_rescue

1. Make a drive image # pv -tpreb /dev/sdb | dd of=/mnt/backup/disk_image.img bs=1M 2. Detect mount offset (mount offset=sector size*partition start) # fdisk -l /mnt/backup/disk_image.img

17 Dub

HowTo: copy disk (image) using dd command with progressbar

Create image from disk /dev/sdb to image file /mnt/backup/disk_image.img. BS is for speedup. # pv -tpreb /dev/sdb | dd of=/mnt/backup/disk_image.img bs=1M Tranfer preview: 932GB 2:46:17 [95,6MB/s] [=============================================>] 100%

09 Bře

HowTo fix Warning: Couldn’t execute ‚show events‘: Access denied for user ‚root’@’localhost‘ to database ‚performance_schema‘ (1044)

This is a virtual database so you will need to add the option –skip-events to make it work.

02 Led

HowTo Fix: Libreoffice crashes when saving document

Try to enable ugly LibreOffice native dialogs Menu „Tools“ -> „Options…“ -> „General“ -> In section „Open/Save dialogs“ just enable „Use LibreOffice dialogs“

Hodžův blog is is proudly powered by Wordpress and the Magellan Theme