Jemu

8 days ago

  Am   G     Am
Jemu masa menyinta
      G       Am
Resah ku meronta
    G     C          Am
Aku telah sumpah setia
  F   G Am
Namun sia

  Am   G    Am
Jemu masa melangkah
      G      Am
Lepas dari dosa
        G   C        Am
Bangkit aku dari lamunan
        F   G    Am
Yang engkau kejutkan

C         Am
Segala pintamu
Dm           G
Cuba ku turutkan
C         Am
Segala janjiku
Dm           G
Peritku lunaskan
Dm               G
Mudah kau melepaskan

E                  Am  G
Kau yang menghancurkan
F      G
Lerai ikatan
E                 Am
Kau cipta seribu alasan

Am   G    Am
Yang kudendamkan
        G     Am
Menjadi kemarahan
      G       C        Am
Kau selindung kesalahanmu
        F     G      Am
Kau singkap kesalahanku
Archayl Wizzpunk

May

Comment

ImageMagick Windows batch operation

42 days ago

Simple operation:

mogrify -resize 640x640 *.jpg

For more complex job:

for %F in (*.jpg) do convert -resize 640x640 %F
Archayl Wizzpunk

Imagemagick

Comment

Simple image resizing using ImageMagick

42 days ago

convert -resize 640x640 in.jpg out.jpg

convert – command
-resize 640x640 – resize option with 640 pixel constraint, longest side can’t exceed specified dimension, will resize preserving aspect ratio
in.jpg – input file
out.jpg – output file name

Archayl Wizzpunk

Imagemagick

Comment

Adding js and css syntax highlighting to page

270 days ago

I’d like to try to add a syntax highlighting feature to this site. I recall some js and css works that do just that. The feature’s purpose is to clarify the information on the site, making codes obvious and easy to digest, pretty to the eyes. Code is not always boring, it might as well be colourful!

As a result of digging around the web, I’ve found a couple of method to do this. I take the simplest and fastest to implement on this site, which is prettify by mikesamuel. This snippet is really simple and easy to use. Just needed some additional lines in the template code.

Download, upload, and link and looks more or less like this in your template HTML head section.

<script type="text/javascript" src="prettify/prettify.js"></script>
<link rel="stylesheet" type="text/css" href="prettify/prettify.css" />

That’s for the linking part. Now on to loading part. Modify your body opening tag so it look like this.

<body onload="prettyPrint()">

Done for the prettify section. On to the next problem.

I dont want to modify my published article just for the sake of adding prettyprint class to each of pre tags. To resolve this problem, I decided to use jQuery. Following the same process like prettify, download, upload, and link. In the head section:

<script type="text/javascript" src="jquery.js"></script>

and add new snippet of code somewhere in the head after the above link statement.

<script type="text/javascript">
    $(document).ready(function() {
        $("pre").addClass("prettyprint");
    });

What that snippet does is append prettyprint class to every pre tags in the current page, enabling prettify to capture and prettify them. All this without changing the source data.

Nice and easy, thanks prettify and jQuery developers!

Archayl Wizzpunk

Web design, Web development

Comment

Digging command history in BASH

272 days ago

I’ve been checking my server for the status of wget that I’ve left running. To my surprise, it was halted. Frustrated by the long url which I’ve entered previously, I go for some bash magic research.

I found out that bash has a neat feature which allows us to retrieve what’s been entered previously, and not just by pressing the up arrow on the keyboard. It can be done in multiple ways, but I prefer the generic one which utilizes grep command.

In my case, to find previous wget command entry line:

history | grep -i "wget"

Nice and simple. The -i following the grep is for case insensitive search. This command will results in a list of command history. Pick the number of history that we are interested in which is on the leftmost column, and append it to a !, like so:

!1999

There you go, the command will be executed instantly! Congrats.

If it happens that you want to get the command and modify it, append :p to the recall line

!1999:p

press Enter and press up arrow. Neat.

Archayl Wizzpunk

Admin, Ubuntu

Comment

« Older