Skip to content

Instantly share code, notes, and snippets.

View hackman's full-sized avatar

Marian Marinov hackman

View GitHub Profile
@hackman
hackman / apc-pdu.sh
Created December 27, 2024 15:24
Manage the power outlets of old APC PDU
#!/bin/bash
apc_url='http://192.168.2.82'
auth='apc:apc'
usage() {
echo -e "Usage: $0 server on|off\nExample: $0 arista on\n"
exit
}
if [[ $# -ne 2 ]]; then
usage
@hackman
hackman / pci-reset.sh
Created November 14, 2021 23:56
Script to reset a PCI device
#!/bin/bash
dev=$1
if [[ -z $dev ]]; then
echo "Error: no device specified"
exit 1
fi
if [[ ! -e /sys/bus/pci/devices/$dev ]]; then
@hackman
hackman / copy-data.sh
Created November 14, 2021 23:52
Script to copy data from broken hard drive with DD :)
#!/bin/bash
dst_drive=/dev/sda
src_drive=sdd
skip_drive=sdb
dd_status=/tmp/dd
log_file=/tmp/dd.log
size_file=/tmp/last_size
slot=32:1
@hackman
hackman / gist:09dc4826c1110a48ab68e33bb6968ee7
Created October 17, 2017 21:25
mirrors.linux-bulgaira.org
hackman@terion:~$ rsync rsync://mirrors.linux-bulgaria.org
_ _
| | (_) [email protected]
| | _ _ __ _ _ __ __
| | | | | '_ \ | | | | \ \/ /
| |____ | | | | | | | |_| | > <
|______| |_| |_| |_| \__,_| /_/\_\
____ _ _
| _ \ | | (_)
| |_) | _ _ | | __ _ __ _ _ __ _ __ _
@hackman
hackman / elliptics linkage error
Created February 12, 2013 10:48
elliptics linkage error
With just cloned repo:
[root@animal elliptics]# git pull
Already up-to-date.
[root@animal elliptics]# git br
* master
[root@animal elliptics]#
[root@animal elliptics]# export LDFLAGS="-Wl,-z,defs"
[root@animal elliptics]# export DESTDIR="/root/build/el-build/"
[root@animal elliptics]# cmake -DWITH_COCAINE=NO .