This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SOURCE: https://blog.pessoft.com/2019/09/06/mikrotik-script-automatic-dns-records-from-dhcp-leases/ | |
# When "1" all DNS entries with IP address of DHCP lease are removed | |
:local dnsRemoveAllByIp "1" | |
# When "1" all DNS entries with hostname of DHCP lease are removed | |
:local dnsRemoveAllByName "1" | |
# When "1" addition and removal of DNS entries is always done also for non-FQDN hostname | |
:local dnsAlwaysNonfqdn "1" | |
# DNS domain to add after DHCP client hostname | |
:local dnsDomain "mydomain.lan" | |
# DNS TTL to set for DNS entries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for upgrading guacamole (https://guacamole.incubator.apache.org/) | |
# change version and execute | |
# should download war and deploy into tomcat8 | |
# and download server, and install it | |
VER="0.9.12-incubating" | |
DEPS="libfreerdp-dev libpango1.0-dev libavcodec-dev libavutil-dev libssh2-1-dev libssl-dev libswscale-dev libvncserver-dev libvorbis-dev libpulse-dev libwebp-dev" | |
apt-get install $DEPS | |
cd /var/lib/tomcat8/webapps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$directory = "sample_photos/images/"; | |
$images = glob($directory . "*.jpg"); | |
foreach($images as $image) | |
{ | |
$t = str_replace("images", "thumbnails", $image); | |
echo "<a href='" . $image . "' title='test' rel='lightbox[Brussels]'><img src='" . $t . "' /></a>'"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREPVARS1='overall-health|ATTRIBUTE_NAME|Raw_Read_Error_Rate|Reallocated_Sector_Ct|Load_Retry_Count' | |
GREPVARS2='Power_On_Hours|Temperature_Celsius' | |
DEVICE=/dev/sda | |
sudo smartctl -AH $DEVICE | grep -E $GREPVARS1 | |
sudo smartctl -A $DEVICE | grep -E $GREPVARS2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIMIT=<your limit bandwidth> | |
URL=<your download url> | |
wget -c --limit-rate=$LIMIT $URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISPLAY=:0 notify-send "$(cat /proc/loadavg)" "$(ps hax o comm k -time | head -n 3)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git.clone.profile='mkdir -p $HOME/git; git clone git@gitserver:/home/git/profile.git; chmod 600 $HOME/.ssh/id_rsa*' | |
git.fetch.profile='cd $HOME/git/profile; git fetch --all; git reset --hard origin/master; chmod 600 $HOME/.ssh/id_rsa*' | |
git.push.profile='cd $HOME/git/profile; git add .; git commit -m "$(date +%F)"; git push origin master' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boot from LiveCD | |
mount root partition | |
# mount /dev/sda1 /mnt | |
Chroot | |
# arch-chroot /mnt | |
# grub-install /dev/sda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type l -xtype l |
NewerOlder