Skip to content

Instantly share code, notes, and snippets.

View ruzickap's full-sized avatar

Petr Ruzicka ruzickap

View GitHub Profile
@ruzickap
ruzickap / enclosure_get_info.sh
Last active June 5, 2018 22:46
Get information from HP C7000 enclosure.
#!/bin/bash -x
IP="10.29.33.14"
USER="admin"
PASSWORD="admin"
DESTINATION="./log_directory/"
WGET="wget --no-proxy --user=$USER --password=$PASSWORD --no-check-certificate"
cat > /tmp/hpoa.xml << EOF
<?xml version="1.0"?>
@ruzickap
ruzickap / win7-user.bat
Last active December 27, 2015 21:49
win7 customization file. Run right after you first log in with administrator rights.
:: Tested on Windows 7
echo on
rem for /f "tokens=3" %%i in ('netsh interface ip show addresses "Local Area Connection" ^|findstr IP.Address') do set IP=%%i
rem for /f "tokens=2 delims=. " %%j in ('nslookup %IP% ^|find "Name:"') do set HOSTNAME=%%j
@echo.
@echo Enable Administrator
@ruzickap
ruzickap / win7-admin.bat
Last active October 18, 2023 02:47
win7 customization file. Run right after you first log in as administrator.
:: Tested on Windows 7
@echo.
@echo Test connection settings
powershell -command "$client = new-object System.Net.WebClient; $client.DownloadFile('http://www.google.com', 'c:\del')"
if %ERRORLEVEL% NEQ 0 (
@echo Can not download files form Internet !!!
pause
exit
@ruzickap
ruzickap / create_autostart_iso.sh
Last active December 27, 2015 21:59
Create iso containing VirtIO drivers and autostart script.
#!/bin/bash -x
URL="http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-65.iso"
ISO=`basename $URL`
sudo rm autostart.iso
wget --continue $URL
sudo mount -o loop ./$ISO /mnt/iso
@ruzickap
ruzickap / nfs_hp-ssst.sh
Last active December 29, 2015 12:39
NFS and HP SmartStart Scripting Toolkit installation
yum install -y nfs-utils rpcbind
chkconfig nfs on
mkdir -p /data/hp/
chown -R nfsnobody:nfsnobody /data
cat > /etc/exports << EOF
/data 0.0.0.0/0.0.0.0(ro,no_root_squash,no_subtree_check,async,crossmnt,fsid=0)
/data/hp/ss-scripting-toolkit-linux 0.0.0.0/0.0.0.0(rw,no_root_squash,no_subtree_check,async,crossmnt)
@ruzickap
ruzickap / cobbler_installation_sstk.sh
Last active December 29, 2015 12:59
Cobbler installation
# Install EPEL
MAJOR_RELEASE=`sed 's/.* \([0-9]*\)\.[0-9] .*/\1/' /etc/redhat-release`
cd /tmp/
lftp -e "mget /pub/linux/fedora/epel/6/x86_64/epel-release*.noarch.rpm; quit;" http://ftp.fi.muni.cz/
rpm -Uvh ./epel*${MAJOR_RELEASE}*.noarch.rpm
# Install Cobbler
yum install -y cobbler-web fence-agents git hardlink ipmitool dhcp
sed -i.orig 's/module = authn_denyall/module = authn_configfile/' /etc/cobbler/modules.conf
@ruzickap
ruzickap / cobbler_installation_hpspp.sh
Last active April 21, 2022 09:40
Cobbler installation
# Install EPEL
MAJOR_RELEASE=`sed 's/.* \([0-9]*\)\.[0-9] .*/\1/' /etc/redhat-release`
cd /tmp/
lftp -e "mget /pub/linux/fedora/epel/6/x86_64/epel-release*.noarch.rpm; quit;" http://ftp.fi.muni.cz/
rpm -Uvh ./epel*${MAJOR_RELEASE}*.noarch.rpm
# Install Cobbler
yum install -y cobbler-web fence-agents git hardlink ipmitool dhcp
sed -i.orig 's/module = authn_denyall/module = authn_configfile/' /etc/cobbler/modules.conf
@ruzickap
ruzickap / nfs_hp-hpspp.sh
Last active January 1, 2016 18:09
NFS and HP Service Pack for ProLiant installation
yum install -y nfs-utils rpcbind
chkconfig nfs on
mkdir -p /data/hp/HP_Service_Pack_for_Proliant
chown -R nfsnobody:nfsnobody /data
cat > /etc/exports << EOF
/data 0.0.0.0/0.0.0.0(ro,no_root_squash,no_subtree_check,async,crossmnt,fsid=0)
EOF
@ruzickap
ruzickap / openwrt_ddns.sh
Created April 6, 2014 13:45
OpenWrt DDNS (duckdns.org) configuration
uci set ddns.myddns.enabled=1
uci set ddns.myddns.service_name=duckdns.org
uci set ddns.myddns.domain=gate
uci set ddns.myddns.username=NA
uci set ddns.myddns.password=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
uci set ddns.myddns.ip_source=network
uci set ddns.myddns.ip_network=wan
uci set ddns.myddns.force_interval=72
uci set ddns.myddns.force_unit=hours
uci set ddns.myddns.check_interval=10
@ruzickap
ruzickap / openwrt_luci_statistics.sh
Last active August 12, 2020 17:15
OpenWrt LuCI Statistics additions
opkg install collectd-mod-conntrack collectd-mod-cpu collectd-mod-df collectd-mod-disk collectd-mod-dns collectd-mod-irq collectd-mod-memory collectd-mod-ping collectd-mod-processes collectd-mod-syslog collectd-mod-tcpconns collectd-mod-uptime
mkdir -p /etc/collectd/conf.d
#Make the stats permanent
uci set luci_statistics.collectd_rrdtool.DataDir=/etc/collectd
uci set luci_statistics.collectd_ping.enable=1
uci set luci_statistics.collectd_ping.Hosts=www.google.com
uci set luci_statistics.collectd_df.enable=1
uci set luci_statistics.collectd_df.Devices=/dev/mmcblk0p1
uci set luci_statistics.collectd_df.MountPoints=/data