You are currently browsing the Perl category
Displaying 1 - 7 of 7 entries.

MacOs: ISO to USB-Stick Perl script

  • Posted on November 3, 2019 at 17:18

Making bootable USB sticks was always easy with MacOs and Balena Etcher. But for some reason this stopped working (for me) with Catalina.

But not to worry! It can now be done with this Perl script I wrote today:
Usage is simple. Help message says it all.
And here with syntax highlighting. Just because we can.

$ ./
You have to be root!
Usage. : # ./ isofile device
Example: # ./ /Users/krusjme/Downloads/kubuntu19.iso /dev/disk2

The script takes care of basically al the hassle that you may run into doing all the command line stuff yourself. It unmounts all possibly mounted volumes on the destination device and it doesn’t nag about existing files. It just overwrites them. On top of that it shows a performance indicator thanks to gdd instead of good old dd.

Here, something like a ‘screen shot’! 🙂

$ sudo ./ CentOS-7-x86_64-NetInstall-1908.iso disk2
Destination disk is given without /dev. Adding it now
Full destination path is: /dev/disk2
Inventorizing possible mounts on destination disk
Unmounting volumes on destination disk
Umounting volume: /dev/disk2s1
Volume TESTVOLUME on disk2s1 unmounted
Making up HDIUtil-command
Converting iso to raw image
Reading Master Boot Record (MBR : 0)…
Reading CentOS 7 x86_64                  (Apple_ISO : 1)…
Reading  (Type EF : 2)…
Reading CentOS 7 x86_64                  (Apple_ISO : 3)…
Elapsed Time:  1.024s
Speed: 539.0Mbytes/sec
Savings: 0.0%
created: /Users/KrusjMe/Desktop/iso2usbstick/CentOS-7-x86_64-NetInstall-1908.dmg
Making up DD-command
DD-command: /opt/local/bin/gdd bs=1M status=progress if=CentOS-7-x86_64-NetInstall-1908.dmg of=/dev/disk2
578551808 bytes (579 MB, 552 MiB) copied, 158 s, 3.7 MB/s
551+1 records in
551+1 records out
578551808 bytes (579 MB, 552 MiB) copied, 158.053 s, 3.7 MB/s 

With thanks to for the command line instructions

All you need in CPAN

  • Posted on June 24, 2019 at 00:54

Just copy-paste:

Authen::NTLM Bundle::CPAN Config::Simple Digest::SHA Digest::SHA1 Digest::SHA2 Digest::SHA256 Digest::SHA3 Digest::xxHash Email::Find Email::Send::SMTP::TLS Email::Sender Email::Simple File::Binary lib::relative Log::Log4perl Moose MooseX MooseX::ClassAttribute MooseX::MultiMethods MooseX::Singleton namespace::autoclean SQL::Abstract

Perl and macOS Mojave: Header files not found. Use Perlbrew!

  • Posted on November 29, 2018 at 23:15

Having trouble in CPAN, getting messages like: fatal error: ‘EXTERN.h’ file not found.
Use Perlbrew and all your worries are gone.

$ brew install perl

$ brew link –overwrite perl

After this Perl and CPAN are installed /usr/local/bin:

$ which perl cpan




LISA Prerequisites

  • Posted on January 1, 2016 at 15:34

Super Quick Start Guide II: LISA

# pacman -Sy perl-dbd-pg
# cpan
cpan> install lib::relative
cpan> install Filesys::Df
cpan> install Moose
cpan> install namespace::autoclean
cpan> install DBI
cpan> install SQL::Abstract
cpan> install xxHash
cpan> install Filesys::DiskFree
cpan> install Filesys::Path
cpan> install Config::Simple
cpan> install Email::Send::SMTP::TLS
cpan> install Email::Simple

File names:

  • Transponder:
    Call: ./transponder/ 3
  • Heartbeat Share Checker:
    Call: .heartbeat// –runmode=3 –interval=60
  • Acquire Storage Device: lisa-dn-acquire-storage-device-1.3.1pl
    Call: ./bootdisk/lisa-dn-acquire-storage-device-1.3.1pl 3
  • Acquire Computer:
    Call: ./bootdisk/ 3

Everything you really need in Arch

  • Posted on December 13, 2015 at 18:07

Creating a list of everything installed:

# pacman -Qe | awk '{print $1 " \\" }'


apache \
atril \
autoconf \
automake \
bash \
bind-tools \
binutils \
bison \
bzip2 \
caja-gksu \
caja-image-converter \
caja-open-terminal \
caja-sendto \
caja-share \
coreutils \
cryptsetup \
device-mapper \
dcfldd \
dhcpcd \
dialog \
diffutils \
e2fsprogs \
engrampa \
eom \
fakeroot \
file \
filesystem \
findutils \
flex \
foremost \
fping \
galculator-gtk2 \
gawk \
gcc \
gcc-libs \
gettext \
glibc \
grep \
groff \
grub \
gzip \
hfsprogs \
htop \
inetutils \
iproute2 \
iputils \
jfsutils \
less \
libtool \
licenses \
lightdm \
linux \
logrotate \
lsof \
lvm2 \
m4 \
make \
man-db \
man-pages \
marco \
mate-applets \
mate-backgrounds \
mate-control-center \
mate-icon-theme-faenza \
mate-media \
mate-netspeed \
mate-notification-daemon \
mate-power-manager \
mate-screensaver \
mate-sensors-applet \
mate-system-monitor \
mate-terminal \
mate-themes \
mate-user-guide \
mate-user-share \
mate-utils \
mc \
mdadm \
mlocate \
mozo \
mtools \
nano \
net-tools \
netctl \
nfs-utils \
nmap \
openssh \
os-prober \
p7zip \
php-apache \
php-gd \
pacman \
par2cmdline \
patch \
pciutils \
pcmciautils \
perl \
perl-dbd-pg \
pkg-config \
pluma \
postgresql \
procps-ng \
psmisc \
reiserfsprogs \
rsync \
s-nail \
screen \
sed \
shadow \
sleuthkit \
sshfs \
sudo \
sysfsutils \
tar \
testdisk \
texinfo \
tree \
unrar \
usbutils \
util-linux \
vi \
vim \
vimpager \
wget \
which \
xfsprogs \
zip \

And then CPAN:


Knowing your dynamic IP-address

  • Posted on July 25, 2011 at 18:53

The troubling situation
Being a nerd, there is nothing more frustrating than having a dynamic IP-address.
Being a nerd and doing some hosting locally actually makes it even wors!

There’s not much use to running services like Apache or Sendmail with an IP-address that changes at random times.
Random in this particular case means: “When we of Ziggo want it to!”.

Alert by email
So what you basically want is to be alerted whenever you IP has changed.
I wrote some perl-code that does exactly that! And as a bonus, it does some handy logging.
The script can be initiated from command-line, but the best way is making a cronjob of course.

Realworld example
I created two new e-mailadresses; and Both addresses are now configured on my iPhone to receive all mail automatically,
In the cron, I set it to run as an hourly-job,
And then I did “the Dutch approach“…

Thanks to Vim it was quite easy to make the sourcecode readable using :TOhtml.
If you love to see the amazing Vim-output or you’re actually seriously interested: You can find the sourcecode here:
Download directly:


  • download the script, (for example to /usr/local/bin)
  • change the email-addresses to your preferred ones,
  • change the interface-card, (eth1, eth0 or whatever)
  • mkdir /var/log/newip /var/newip,
  • chmod 755 /usr/local/bin/,

Testing / Forcing
If you want to test it, just run the script from command-line using:
# /usr/local/bin/newip-2.0 --force-mail

CPAN, MacPorts and Eclipse: The hard-life

  • Posted on January 24, 2011 at 10:21

Developing machine configuration
My workstation is an Apple MacPro, running Snow Leopard. And I do my developing in Eclipse. For me undoubtedly the number one IDE. The Perl-support is really fantastic.
Unless you installed MacPorts!

Although I was sure I installed the used CPAN-Modules, Eclipse kept complaining about not able to find them, blablabla….
Eclipse Error: Can't find CPAN Module

MacPorts installed it’s own Perl! Although not necessarily, it can happen easily. With a little bit of playing around in MacPorts, it’s quite probable than MacPorts installed it’s own Perl. Although it really isn’t a big issue in everyday use. (I never ran into any trouble, so far) it may result in Eclipse fooling you.
Because since my OS now by default uses the MacPorts version of Perl, it will also use the CPAN that’s installed by MacPorts. And, once again: It works just fine!
The only trouble is Eclipse. Eclipse, or actually E-P-I-C, still only looks in the default Perl search-paths.
So if you install a new module using CPAN when MacPorts has installed Perl, it will install that new module in the MacPorts-CPAN-Path, and not in the default OSX-CPAN-Path. That’s all!

Just install your CPAN module also in the default OS X-Path using the absolute path.
$ sudo /usr/bin/cpan
cpan> install Archive::TarGzip
cpan> reload cpan
cpan> exit

Now restart your Eclipse….
Problem solved!