Feeds:
Posts
Comments

Archive for May, 2019

What is Crontab?
Before I answer that question, I will introduce with a linux application called cron. Cron is a daemon (program that runs behind the scene) to execute scheduled commands (Vixie Cron). In another word, cron is an automated time based script execution. Cron is started automatically from /etc/init.d on entering multi-user runlevels. Cron is commonly used for automating system maintenance or administration jobs that may need to run periodically. The term of Cron Jobs is referred from Cron task or jobs.

Any programs that we put in the task scheduler will be placed in a file named ‘crontab file‘.
Cron wakes up every minute to examine all stored crontabs and checking each command to see if it should be run in the current minute.
In this tutorial, I use Linux Ubuntu 11.10.

Let’s check the file. Go to /etc directory and search the file.

$ ls -l crontab
-rw-r--r-- 1 root root 723 2019-05-27 23:11 crontab
$ cat crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
$

This is the content of my cron file. As you can see, there are 4 cron jobs in my crontab file.
crontab01.png
(more…)

Read Full Post »

JP2A is an application that convert JPG images to ASCII characters. It’s text based, so you need to run in Linux Terminal. Jp2A does not interpolate when resizing. If you want better quality, use “convert” to produce exact output dimensions before using jp2a.

You can install it by typing: “sudo apt-get install jp2a” in your Linux Terminal.
Since I have my jp2a installed already, the display may be different with you.
jp2a-01
Before we start, prepare a small image size.


My image file name is gnome.jpg. To convert the image, just type: jp2a .

$ ls -l gnome.jpg
-rw------- 1 darklinux darklinux 2553 2013-02-26 23:12 gnome.jpg
$ jp2a gnome.jpg

jp2a-03.png
(more…)

Read Full Post »

Banshee is a media player that use Gstreamer multimedia platform for encoding and decoding various media format. Available for Linux, Windows and Mac. Banshee is released under MIT license. Banshee was the default music player in Ubuntu for few years before replaced with Rythmbox.
Since September 2010, Banshee support iPod, iPhone and iPod Touch.

In this tutorial I use:
Banshee ver 2.2.1
Linux Ubuntu 11.10 Oneiric Ocelot
iPod Nano 5 Generation

Let’s start.
First, check if your iPod is recognized or not.
Connect your iPod to your computer, open Linux Terminal and type “lsusb”. This command will list down any USB devises connected to your system.

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b008 Chicony Electronics Co., Ltd USB 2.0 Camera
Bus 001 Device 006: ID 05ac:1265 Apple, Inc. iPod Nano 5.Gen
$

As you can see, my iPod is recognized as iPod Nano 5.Gen.
banshee00
(more…)

Read Full Post »

Speedtest-cli is an application to check your Internet Speed with command line in linux terminal. This program is written with python and using speedtest.net as the source.
There are few guidelines in the Internet that mentioned how to install it. In this tutorial, I use Xubuntu 11.10 with xfce 4.8 as desktop environtment.

First, I’ve tried to install via apt-get install but it didn’t work for me.

$ sudo apt-get install speedtest-cli
[sudo] password for darklinux:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package speedtest-cli

Then I tried to install via PIP (package manager for Python packages), still didn’t work also.

$ pip install speedtest-cli
Downloading/unpacking speedtest-cli
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement speedtest-cli
No distributions at all found for speedtest-cli
Storing complete log in /home/darklinux/.pip/pip.log

Finally, I download directly from the source via github.

$ git clone https://github.com/sivel/speedtest-cli
Cloning into speedtest-cli...
remote: Enumerating objects: 1150, done.
remote: Total 1150 (delta 0), reused 0 (delta 0), pack-reused 1150
Receiving objects: 100% (1150/1150), 310.06 KiB | 32 KiB/s, done.
Resolving deltas: 100% (684/684), done.
$ ls -l speedtest-cli/
total 112
-rw-rw-r-- 1 darklinux darklinux 1671 2019-05-12 09:40 CONTRIBUTING.md
-rw-rw-r-- 1 darklinux darklinux 11358 2019-05-12 09:40 LICENSE
-rw-rw-r-- 1 darklinux darklinux 35 2019-05-12 09:40 MANIFEST.in
-rw-rw-r-- 1 darklinux darklinux 5606 2019-05-12 09:40 README.rst
-rw-rw-r-- 1 darklinux darklinux 20 2019-05-12 09:40 setup.cfg
-rw-rw-r-- 1 darklinux darklinux 3272 2019-05-12 09:40 setup.py
-rw-rw-r-- 1 darklinux darklinux 3039 2019-05-12 09:40 speedtest-cli.1
-rwxrwxr-x 1 darklinux darklinux 63234 2019-05-12 09:40 speedtest.py
drwxrwxr-x 3 darklinux darklinux 4096 2019-05-12 09:40 tests
-rw-rw-r-- 1 darklinux darklinux 497 2019-05-12 09:40 tox.ini
$

speedtest01
(more…)

Read Full Post »

What is screen? Screen is a screen manager with terminal emulation in Linux. With Screen, you can create, rename, detach new full windows in it. Then you can run different commands or applications in each window terminal. Each virtual terminal provides the function of DEC VT100 terminal and few functions of ANSI X3.64.

When you run a program in a window terminal and run again in other window terminal, each program will run completely independent. Mean if you move between windows, the program are still running.

There are few similar applications that you can use, ‘terminator, guake, yakuake, tilda, etc’ but screen is very light and easy to use once you get used to with it.

How to install?
Make you are connected to Internet, open your Linux terminal, and type: apt-get install screen.
I have screen installed already in my system, so the message will be different with you.
screen0

To run the screen, just type: ‘screen’ in linux terminal and press Enter to continue.
It will create a single window with a shell in it.
$ screen
screen1

Welcome screen will be displayed.
screen2

You will get an empty terminal, look like normal terminal but it’s not. You are already in Screen shell.
screen3

Type any command in it.
For example, I use ‘dig’ command.
screen4.png

Before we start, there are few commands that you need to remember.

-rename the current screen → ctrl+a+A (ctrl+a ctrl+shift+A)
-create a new screen → ctrl+a c
-select your screen → ctrl+a '
-display screen list → ctrl+a “ (ctrl+a ctrl+') it's depend on your keyboard.
-activate screen 0 → ctrl+a 0
-activate screen 1 → ctrl+a 1
-close active screen → ctrl+a k (ctrl+a k), only active screen close.
-detach screen → ctrl+a d (ctrl+a d), will close all screen.

(more…)

Read Full Post »

I believe you have already read my article about How to install MS-DOS 6.22 in virtual box. Now, I will guide you how to install CD driver in MS-DOS 6.22.

Below are the steps:

1.Download the CD driver.
2.Create an floppy disk image.
3.Create a virtual floppy disk drive.
4.Mount the image file to the floppy drive.
5.Copy the driver.
6.Unmount and remote the virtual floppy disk.
7.Run DOS in the Virtual box.
8.Edit AUTOEXEC.BAT file.
9.Edit Config.sys file.
10.Reboot the DOS system

Step 1. Download the CD Driver
First, you have to download the CD/DVD driver.
The driver is oakcdrom.sys. You can get it from http://www.scriptco.net/rr/cdrom_info.htm
Then you have to copy it into a floppy disc image or a CDrom.
The easy one is just create an floppy disc image and copy the driver into it.

Step 2. Create a Floppy disk image
Open your Linux terminal.
Change your access to root.
Create a 1.44 MB floppy disc using linux command “mkfs.msdos“. It will create an MS-DOS file system under linux.
-Option “-C” is used to create the new file system in a file instead of a real device.
-Option “1440“ is the size of the floppy disk image.

$ mkfs.msdos -C myfloppy.img 1440
mkfs.msdos 3.0.9 (31 Jan 2010)

option -C means, create the file given (myfloppy.img) as device.
1440 means, the size is 1.44MB.

Let’s check the result.

$ ls -l myfloppy.img
-rw-rw-r-- 1 darklinux darklinux 1474560 2019-05-16 05:07 myfloppy.img

Good, now you have a floppy disk image.
doscd01.png

(more…)

Read Full Post »

I will explain to you how to install MS-DOS 6.22 (Microsoft Disc Operating System version 6.22) in virtual box. This version supports cd/dvd driver, usb and network.

If you want to play the old DOS games or old DOS applications, it will easier for you.

Before we start, few things you have to do:
1. Download the MS-DOS installation images from the link below:

https://www.dropbox.com/sh/jzm0fbnb7fz526u/mKJ19A1JMo
There are 3 images files that represent 3 floppy discs. The extension file is .img.
-setupdisk1.img
-setupdisk2.img
-setupdisk2.img

Rename it to .dsk.
So, it will become:
-setupdisk1.dsk
-setupdisk2.dsk
-setupdisk2.dsk

There are few process that need to be done.

-Create the virtual hard disk
-Create the hard disk partition
-Format the hard disk
-Installation

Now, we can start to install this operating system in VirtualBox. MS-DOS doesn’t need much space. So, 100MB hard disc space is enough to play around. But if you want to add the networking on it I suggest to provide 200MB hard disc space. For memory you can use the default 32 MB.

 (more…)

Read Full Post »