Quantcast
Channel: /dev/neant
Browsing all 28 articles
Browse latest View live

Force Windows Update

I keep forgetting this. wuauclt /detectnow

View Article


Cloning a disk using dump/restore

OpenBSD edition. A script that will produce a copy of an original disk, will run installboot(8) on it and replace the disk UID in /etc/fstab with the clone’s UID. The purpose is to produce a copy of...

View Article


Script to add spamhaus’ DROP list to pf

Spamhaus‘ DROP (Don’t Route Or Peer) and EDROP lists are sets of IPs controlled by bad people. Basically IPs that are very likely going to cause trouble so might as well block them completely. Details....

View Article

Setting the time zone on domain computers through Group Policy

The time zone settings in Windows are kept in registry, in two places. One has a list of all available time zones and their settings and the other has the currently set time zone. When the zone changes...

View Article

Monitoring Adaptec RAID arrays with arcconf

arcconf is a utility that can be used to configure and manage Adaptec RAID arrays. It can also be used to query the status of the array. Below is a script that parses the result of the query looking...

View Article


Parse the last minutes of a log file

#!/bin/sh # for FreeBSD # returns how many times $STRING shows up in $LOGFILE # in the last $MINUTES minutes # if $LINES is passed to the script, only so many lines # will be parsed # assumes a time...

View Article

CARP and DHCP on FreeBSD

Problem: setting CARP on an interface that is set by DHCP on FreeBSD leaves the carp interface locked in INIT state after reboot: hostname="server.exemple.com" ifconfig_bce0="DHCP" # CARP...

View Article

ZFS root on FreeBSD 9.1

Throwing this here mostly for myself. After repeated failures at installing FreeBSD 9.1 straight on ZFS, mostly because of typos, I decided to create a script to do it. It will probably be superfluous...

View Article


Building a package repository for FreeBSD with poudriere and pkgng

Overview This post covers building a server that will be used to update both ports and the base system on FreeBSD backend servers that don’t have access to the Internet. For ports it will use poudriere...

View Article


Redirect top level domain in nginx

How to redirect something like “www.example.org” to “www.example.com“, or “longer.subdomain.example.org” to “longer.subdomain.example.com” with a rewrite rule in nginx.conf: server { listen 80;...

View Article

Enable VNC on virtualbox-ose >=4.2

If you have: % VBoxManage  list extpacks Extension Packs: 1 Pack no. 0: VNC Version: 4.2.6_OSE Revision: 82870 Edition: Description: VNC plugin module VRDE Module: VBoxVNC Usable: true Why unusable:...

View Article

Continuous rsync script

A shell script that keeps running rsync in a loop until a file is created to stop it. Obviously not the right way to do such things, but good enough for a quickie. #!/bin/sh while : do if [ -f...

View Article

NFS mount from a Linux server returns ‘permission denied’

… but everything is set up properly. Check if there is anything under /proc/fs/nfsd/. If there isn’t, run # mount -t nfsd nfsd /proc/nfs/nfsd Apparently it happens when NFS support has been compiled...

View Article


Shell script to backup WordPress, site and database

I’ve been using this shell script to backup my WordPress site and database for a while. There is nothing WordPress-specific in it though, the script can be used for anything that uses a database. It...

View Article

Backup files on Google Drive using Google Apps Script

My ideea was to set up a script running on Google’s servers that would automatically get files from my site and back them up on Google Drive. I would have gotten a free off-site backup. Unsurprisingly,...

View Article


Monitor AWS VPN from Python

Short demo script in Python that monitors the VPN tunnels in Amazon Web Services. It queries the current state every 1.5 seconds in a loop and if the state changes it writes the new state to a log...

View Article

Enable VirtualBox guest additions features in X

In order to take advantage of shared clipboard, seamless integration and drag&drop features of VirtualBox two things are needed. First, the guest additions need to be installed, pretty...

View Article


Inject strings on an already open TCP/IP connection using gdb

Had a situation at $WORK where network connections were just hanging there, open, with no activity. So I needed to send something, whatever, on the open connection, just to see how it behaves. TL;DR:...

View Article

Python library for managing AWS logs

In Amazon Web Services it’s possible to enable logging for the whole VPC (CloudTrail) or for various services provided by Amazon, like S3. These logs get stored in S3 buckets. They are generated every...

View Article

AWS permissions – S3

A set of permissions to be used on Amazon Web Services Simple Storage Service (AWS S3) buckets. Each of them should be attached to a different group. The set imitates the Unix permissions model (rwx),...

View Article
Browsing all 28 articles
Browse latest View live