Perl, Perl 5, Programming/Coding, Science

DevOps in Perl? Consider Rex.

Rex is a ‘Deployment & Configuration Management’ also knows as DevOps framework. Interestingly, it is in Perl, for Perl language. There is Ruby’s Chef & Puppet, Python’s Ansible, and Perl also has those frameworks too, but here I’m pointing to Rex because it will be much more familiar to Puppet, Chef and Ansible users in syntax and workflow perspectives.

Why do this in Perl?

Perl itself has been designed and well known for its powerful features on sysadmin tasks. Combine with this kind of framework, you are just gonna be much happier on getting the job done. Fortunately, if you are trying to opt to write ‘maintainable and long-term modules/scripts’ without using Rex, Modern Perl as a guideline should help you doing so, and CPAN with much lesser code in general.

Advertisements
Uncategorized

LXC: The Linux Containers

DISCLAIMER: This article is for 32 bit pc users, since` Docker cannot use 32 bit machine as a host system.

Did you ever found that running virtual machine on 32 bit computer is really slow and can be considered as memory hog? Did you ever found that running chroot and debootstrap together to create a jail or isolated root directory is just too limited and time consuming?

Then LXC is for you.

Introducing LXC

  • What is LXC anyway?
    • LXC is a userspace interface for the Linux kernel containment features
      Through a powerful API and simple tools, it lets Linux users easily create and manage system or application containers.
  • Why you should try LXC?
    • Template(distribution image) installation in LXC is simple as lxc-create -t centos -n myCentosContainer.
    • It has more pre-configurations than pure chrooting.
    • It use far less resources than using virtual machine such as
      Oracle VirtualBox.
    • If you are a command line assassin. 🙂

Read More

Uncategorized

Perl module: App::Pastebin::Create

What is App::Pastebin::Create?

It’s a pastebin creator + uploader for pastebin.com, a tool written in Perl.

How to use it?

pastebin-create --text "Your text" --format 'perl' --expiry 10m --private 0 --desc "My perl mod title"

This will result a link to the public paste, with “My perl mod title” as the paste description, that will expiry in 10 minutes, with perl syntax highlighting, and “Your text” as the content.

How to install?

make sure you already configured CPAN first!

I recommend using cpanm instead of cpan for installation. To install cpanm, you need to run cpan App::cpanminus first.

From my forked distribution on Github (maintained by me):

bash <(curl -L https://gist.githubusercontent.com/faraco/b6acb4626da6962ad46aa7e250d1ac12/raw/d433116845cb0a3ce849edb75789a6053ef4e2ce/install.bash)

With cpanm (official CPAN): > `cpanm App::Pastebin::Create`

with cpan:

cpan App::Pastebin::Create


Read More

Tags: perl, programming, linux, unix, module, library, pastebin

Uncategorized

Linux distribution: ToriOS

I always try to find a better alternative for my slow machine that are used for daily casual routines, such as browsing and reading.

My case with Lubuntu (14.04)

I’m a user of Lubuntu before, and I’m happy with it, at least for lesser than a year. Lubuntu is a fast and lightweight operating system, and I have an agreement with that based on that perspective. However it’s not fast enough (in term of response time) and usually the applications keep crashing, unexpected (I’m looking at you Lubuntu 14.04).

Why not Ubuntu minimal install and work my way through

Time is important to me, and I have to configure the system everytime (although shell scripting did help a lot automating part of this) whenever I want to use it, for my daily tasks. Thus, my internet connection is not that fast to download from the repository for the required packages to run the installation.
So I searched for other alternative, and found ToriOS.

So what is ToriOS?

Based on ToriOS) main page:

ToriOS is a GNU/Linux Operating System built for very old computers (NON PAE) and for those who are interested and brave enough to build their own system the way they like from a fully working base with GUI and minimal installed packages by default.

Whenever I found this project (through launchpad), I quickly try running a live version (it was before ToriOS 1.0 was released, but cannot find the version I installed before) of this distro with USB, and it is as what it is quoted above in the page. It’s like a sister to Lubuntu, but from a different father and ideology. It is a fast and minimal distro, but with default lightweight GUI (jwm) as its desktop environment, opposed to Ubuntu minimal installation where you get in the first place, is just the command line interface.

Conclusion

Nothing is perfect. ToriOS is also a part of that. It has some quirks with its GUI, and the applications contain some annoying bugs that makes me sticking with Xubuntu, and the installation with OBI sometimes not worked very well. However, the ToriOS 1.0 has been released, and I believe these issues were already fixed in the latest release. Regardless of its weaknesses, you should give this distro a try, and decide it for yourself.