Skip to content

Instantly share code, notes, and snippets.

View lemenkov's full-sized avatar

Peter Lemenkov lemenkov

View GitHub Profile
@lemenkov
lemenkov / make_virt.sh
Created September 25, 2013 15:01
How to build VM for Qemu/KVM w/o using virt-manager.
#!/bin/sh
NAME=$1
virt-install --connect=qemu:///system \
--network=bridge:virbr0 \
--location=http://mirror.yandex.ru/centos/5/os/x86_64/ \
--extra-args="ks=ftp://fileserv.local/pub/kickstarters/${NAME}.ks ip=dhcp console=tty0 console=ttyS0,115200" \
--name=${NAME} \
--disk /var/lib/libvirt/images/${NAME}.img,size=20 \
@lemenkov
lemenkov / gist:6508072
Created September 10, 2013 11:26
What to do when your log is full with the following OpenSIPS messages? Sep 10 15:23:15 sippro /usr/sbin/opensips[6040]: CRITICAL:db_mysql:wrapper_single_mysql_stmt_prepare: driver error (145): Table './opensips/dialog' is marked as crashed and should be repaired
$ mysqlcheck -uopensips -popensipsrw --repair --extended opensips
@lemenkov
lemenkov / gist:6476720
Created September 7, 2013 15:51
How to add new harddisk to LVM
umount /media
pvcreate /dev/sdi
vgextend video /dev/sdi
lvextend -l +100%FREE /dev/mapper/video-video
systemctl start media.mount
xfs_growfs /media
@lemenkov
lemenkov / gist:6079247
Created July 25, 2013 12:43
Regexp for lookbeghind and lookahead
grep -o -P "(?<=elapsed time: )[0-9]*(?= microsec)" ~/messages
@lemenkov
lemenkov / gist:6065865
Created July 23, 2013 20:28
Changing metadata in every commit in a current branch
git filter-branch --env-filter 'GIT_COMMITTER_NAME="autotrace";GIT_COMMITTER_EMAIL="autotrace@host";' HEAD
@lemenkov
lemenkov / gist:6048791
Last active December 20, 2015 01:28
Fedora PPC Koji hub nano-HOWTO
* "real" build
fedpkg clone mypackage
cd mypackage
koji-ppc build rawhide "$(fedpkg giturl)"
* scratchbuild:
koji-ppc build --scratch rawhide /path/to/yourpkg.src.rpm
work ~: gnuplot
gnuplot> set autoscale
gnuplot> plot "results.sched_default" every::15000::50000 using 2 with lines , "results.sched_high" every::15000::50000 using 2 with lines , "results.sched_low" every::15000::50000 using 2 with lines
gnuplot> replot
rpmbuild -bs erlang.spec --define '%el6 1'
@lemenkov
lemenkov / gist:5821575
Created June 20, 2013 09:53
How to mount SAMBA resource w/o password and w/o knowing SAMBA shares' names
$ sudo yum install cifs-utils samba-client
$ smbclient -L 192.168.100.1
Enter petro's password: <press enter for empty password>
Domain=[TIHON] OS=[Windows 7 Ultimate 7601 Service Pack 1] Server=[Windows 7 Ultimate 6.1]
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Удаленный Admin
Bin.Win32 Disk
C$ Disk Стандартный общий ресурс
@lemenkov
lemenkov / gist:5101234
Created March 6, 2013 17:32
Post-install tasks
yum remove sendmail
yum remove Net*
yum install vim-enhanced ssmtp fvwm xorg-x11-server-Xorg rxvt-unicode firefox git
yum install xorg-x11-drv-evdev xorg-x11-drv-intel
yum install net-tools avahi nss-mdns mc
yum install xorg-x11-xdm