Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, October 14, 2020

Easiest way to create Kali Linux LiveUSB with persistence storage...

Your USB drive has a capacity of at least 8GB — the Kali Linux image takes over 3GB.

1. Download Kali Linux iso from here.

2. Use balenaEtcher to write the iso into your pendrive.

3. BalenaEtcher will create 2 partitions:
  • iso9660 - 2.92 GB (your iso image)
  • fat12 - 736 KB

4. Open KDE Partition Manager (GParted detected iso9660 as one partition as a whole) and create new partition (ext3 or ext4) on the third unused space and label it as persistence.
KDE Parition Manager

5. Create a mount point, mount the new partition there, and then create the configuration file to enable persistence. Finally, unmount the partition.
$ sudo mkdir -p /mnt/my_usb
$ sudo mount /dev/sdb3 /mnt/my_usb
$ sudo echo "/ union" > /mnt/my_usb/persistence.conf
$ sudo umount /dev/sdb3


Monday, September 21, 2020

How to test Live USB on VirtualBox Linux...

Plugged in your USB pendrive.

Check your USB drive details:
$ sudo fdisk -l

Add your user to disk group:
$ sudo usermod -a -G disk $USER

Open terminal and run the command below (replace X with your drive). There's no need for sudo:
$ vboxmanage internalcommands createrawvmdk -filename ~/usb.vmdk -rawdisk /dev/sdX

Next open VirtualBox and create new vm. When in the hard disk option, use an existing virtual hard disk file. Select usb.vmdk file that you've created earlier in the previous step.

Complete setup.

Now you can start the newly created vm to test your Live USB.

Sunday, September 20, 2020

From Lysia with love, now on Mikah...

Started to get bored with Ubuntu+Gnome Shell combo. It's time to distro hop!

A friend of mine recommended Manjaro, an Arch based distro. I've never tried an Arch based distro before.

Manjaro officially comes with 3 DEs of choice (XFCE, KDE Plasma and Gnome).

Been using Gnome for quite a while (since Gnome 2 era), might as well I try something new. Downloaded KDE Plasma version and I'm hooked!

Love the AUR, love the rolling release and love the ability to switch kernel.

A happy camper now since April this year.





Friday, September 18, 2020

Install and configure RDP server on Linux...

To install freerdp on Debian, Kali Linux, Linux Mint, Ubuntu and derivatives, run the command:
$ sudo apt install freerdp2-shadow-x11 winpr-utils

To install freerdp on Arch Linux and derivatives, run the command:
$ sudo pacman -S freerdp

To start the RDP server without authentication at all, use the -auth option. Warning: if authentication is disabled, anyone can connect. Only use this option for testing.
$ freerdp-shadow-cli -auth

To start RDP server with authentication:
  • First calculate the hash for password
$ winpr-hash -u myusername -p mypassword

Output:
a991ae45aa987a1a48c8bdc1209ff0e7
  • Next, create SAM (example: my-sam) file and add this text
dirn:::a991ae45aa987a1a48c8bdc1209ff0e7:::
  • Now start RDP server
$ freerdp-shadow-cli /sam-file:my-sam /sec:nla
  • Connect from Windows

Saturday, August 10, 2019

How to change Linux swap partition to different disk...

The scenario:
I have two hard disks on my laptop,
- 256 GB SSD (nvmeOn1)
- 1 TB HDD (sda)

Installed Ubuntu, below is how my partition table looks like:
nvmeOn1
        EFI                                  100 MB
        Microsoft reserved partition          16 MB
        Basic data partition              217.35 GB
        /                                     20 GB
        Recovery                               1 GB
        Unallocated                        14.34 MB

    sda
        Basic data partition              465.76 GB
        /opt                                9.54 GB
        /usr                               37.96 GB
        linux-swap                             6 GB
        /home                             412.26 GB

I want to change swap partition from HDD to SSD. Here's the steps:
1. Boot the machine with Ubuntu Live USB
2. Delete existing linux-swap partition on HDD (Resize any existing partition to make use this new unallocated partition)
3. Resize / partition on SSD to make space for new swap partition
4. Create new swap partition
5. Shutdown, remove Ubuntu Live USB and restart the machine
6. Now in Ubuntu, open terminal and run the command below
$ sudo blkid

    # output would be something like this
    /dev/nvme0n1p6: UUID="581446b5-7fab-46b0-ba3a-569c0fc42be3" TYPE="swap" PARTUUID="646e1aba-ebff-40e7-86c2-155211f485d5"

7. Look for "swap" and copy UUID from the newly created swap partition
8. Edit /etc/fstab file by running command below (don't forget to backup first)
$ sudo nano /etc/fstab

9. Replace the old UUID for swap with the new one.
10. Save the file and reboot the machine.

To verify, we can use free command
$ free

    # output
                  total        used        free      shared  buff/cache   available
    Mem:       32774452     1315660    30136320       34844     1322472    31009776
    Swap:       6292476           0     6292476

Or swapon -s command
$ swapon 0s

    # output
    Filename    Type  Size Used Priority
    /dev/nvme0n1p6                          partition 6292476 0 -2

This is how my new partition table looks like:
nvmeOn1
        EFI                                  100 MB
        Microsoft reserved partition          16 MB
        Basic data partition              217.35 GB
        /                                     14 GB
        linux-swap                             6 GB
        Recovery                               1 GB
        Unallocated                        14.34 MB

    sda
        Basic data partition              465.76 GB
        /opt                                9.54 GB
        /usr                               43.96 GB
        /home                             412.26 GB

Friday, October 21, 2011

Ubuntu 11.10 basic GNOME Shell tweaks...

1) Install GNOME Shell and gnome-tweak-tool, then restart your machine and choose GNOME for your session
$ sudo apt-get install gnome-shell gnome-tweak-tool
2) Install Cantarell font
  • Download font from here
  • Copy font into /usr/share/fonts folder
  • Run command below:
$ sudo fc-cache -f -v
3) Gnome-tweak-tool settings
  • Desktop - turn off everything
  • Fonts:
    • Default font - Cantarell
    • Window title font - Cantarell Bold
  • Shell - Arrangement of buttons on the titlebar - All
  • GTK+ theme - Adwaita (default)

4) Remove overlay scrollbars
$ sudo apt-get remove overlay-scrollbar liboverlay-scrollbar3-0.2-0 liboverlay-scrollbar-0.2-0
5) Fix Alt+F2
  • Go to System Settings -> Keyboard -> Shortcuts -> System, remapping Alt+F2 to Show the run command prompt.

6) Disable Global Menu
$ sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt
7) Change LightDM background via LightDM Manager
  • Download LightDM Manager from here.
  • Install dependencies (not sure why we need to do this manually on 11.10)
  • Install LightDM Manager
    $ sudo apt-get install python-launchpad-integration gtk2-engines-pixbuf
    $ sudo dpkg -i simple-lightdm-manager_0.2-public7_all.deb
8) Fix on Conky script to make it work with GNOME Shell (credit to sgaap)
    own_window_class Conky
    own_window yes
    own_window_type conky
    own_window_transparent yes
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Thursday, October 20, 2011

Ubuntu sex command at man page...

LOL!!! nice joke of the day.

sex man page



oneiric (6) sex.6fun.gz
Provided by: funny-manpages_1.3-5_all

NAME
sex -- have sex

SYNOPSIS
sex [options] ... [username] ...

DESCRIPTION
sex allows the invoker to have sex with the user(s) specified in the
command line. If no users are specified, they are taken from the
LOVERS environment variable. Options to make things more interesting
are as follows:

-1 masturbate

-a external stimulus (aphrodisiac) option

-b buggery

-B animal
bestiality with animal

-c chocolate sauce option

-C chaining option (cuffs included) (see also -m -s -W)

-d file
get a date with the features described in file

-e exhibitionism (image sent to all machines on the net)

-f foreplay option

-F nasal sex with plants

-i coitus interruptus (messy!)

-j jacuzzi option (California sites only)

-l leather option

-m masochism (see -s)

and the list goes on...

Monday, October 3, 2011

GNOME Shell, it's not as bad as it seems to be...

There's so much discussions going on regarding GNOME Shell and Unity. People talked as if the world is going to end soon (okay, I'm a little bit exaggerate here :)). I had this kind of impression after read too much negative posts / comments related to the DEs. Agreed on Unity, after tested it for sometimes, I got to admit that I myself hate it as well.

But GNOME Shell, is a different story, after play it for a while (OpenSuse LiveCD) I found out that it's quite nice. Things like "super key + type app name + enter" and dynamic desktop switcher (predefined number of desktops are not required) was kinda cool. It might feel odd at the beginning when my working and activities (I believe that's how they defined it) mode are separated into two (no launchers or list of applications visible on your desktop unless if you're in the activities mode). But after sometimes, I got used to it. It'll be great if I can interact with objects using keyboard in "Activities" mode. As of now (at the time of writing this post), things like opening apps or selecting existing windows can only be done via mouse clicking.

Of course I still love my current desktop with GNOME 2 (Shell is the core user interface of the GNOME desktop environment starting with version 3). It'll be great if I can customize GNOME Shell to look like my current desktop. It is possible to customize GNOME Shell (via gnome-tweak-tool) but only to certain extend. Things that I'll miss a lot from GNOME 2 are effects from Compiz (since GNOME shell is using Mutter for window compositing and won't work with Compiz), especially desktop cube. It's kind of an unofficial trademark that when others saw the desktop with cube, they knew it's Linux (or at least the idea is from Linux when they saw it on Windows).

I hate the idea of sharing the same interface into multiple devices as well. That seems to be the direction taken by tech companies (MS included) nowadays. Luckily for Linux users, we can change our DE to our liking (or at least the best to our liking). That's the beauty of it, and that's one of the main reason I've learned basic Linux (apart from freeing myself from virus, malware, crapware etc). Yes, I know there's no such thing as secure OS, but at least my mind is at peace when using it.

Tuesday, September 27, 2011

Things to do after upgraded to Katya 64-bit...

Yes, I know it's a late upgrade and the new release is coming soon. But, who cares. I just got a chance to do it last night.

1) Enabling Compiz will cause windows movement lagging
Solution:
  • At CCSM, go to "Composite -> General -> Refresh Rate" and change the value to 60
  • Then go to "OpenGL -> General", unchecked "Sync To VBlank" option

2) Enabling Blur effect, adding "class=Gnome-terminal" will cause windows flicker.
Solution:
  • Use type "Normal" instead
	type=Menu | PopupMenu | DropdownMenu | Tooltip | Notification | Combo | Dnd | Normal

3) Overlay scroll started to annoy me
Solution:
  • Uninstall the library
	$ sudo apt-get --purge remove overlay-scrollbar liboverlay-scrollbar-0.1-0

4) My Quake 3 demo is not working
Solution:
  • Install ia32-libs library
	$ sudo apt-get install ia32-libs

5) No sound from my headphone jack?
Solution:

Saturday, April 30, 2011

My 5 minutes on Ubuntu 11.04...

  • New UI looks nice (but I prefer the old one)
  • New style scrollbar makes me confuse a bit (but it's one of the good thing that I like)
  • Apps menu appear on top panel instead of on its own window (except for Libre Office apps)
  • Quick search for apps (very helpful if you know the name)
  • Unable to customize panel
  • Enabling desktop cube via ccsm will cause top panel and app launcher stop responding. Windows border disappear
  • Overall, I don't like it. I'm glad that I switched to LM last year.

Sunday, April 10, 2011

Batch process images plugin for Gimp...

To install
sudo apt-get install gimp-plugin-registry
If you prefer GUI installer, open Synaptic, search for gimp batch and mark for installation

Synaptic


To use the plugin, open Gimp and go to Filters -> Batch -> Batch Process... menu

GIMP batch process plugin


Add files to be process at Input tab

Input tab


Set value to whichever tab processes that you need and set the image type at Output tab (default is .bmp).

Resize tab


Click Start button.

Note:
Tested with GIMP v 2.6.10 on Linux Mint 64-bit.

Thursday, March 24, 2011

Installing Firefox 4 on Ubuntu...

1) Adding ppa to repositories
    $ sudo add-apt-repository ppa:mozillateam/firefox-stable
2) Update repository
    $ sudo apt-get update
3) Reinstall package to latest version
    $ sudo apt-get --reinstall install firefox
Note:
Tested on Ubuntu 10.04 32-bit and Linux Mint 10 64-bit.

Wednesday, March 9, 2011

USB startup disk creator for Linux and Windows...

Info: If you're searching for "how to create Windows USB installer", click here.

When started playing with Linux distro, I realized that I need to have a lot of blank CDs / DVDs so that I can burn the downloaded iso image and test the LiveCD on my machine (to make sure all the devices working as expected before installing). End up with a lot of cd / dvd installers that been used once and forgotten. Then, saw an option to use USB pendrive as an installer. At initial stage the process was quite tedious, but now since the technology has matured there's a lot of tools available that can do the process easily. I'll list down a few of it for reference. Some history about Live USB.

Prerequisites:
  • Fat32 Formatted Flash Drive
  • PC that can boot from USB

Name: UNetbootin
Platform: Linux / Windows

Summary:
"UNetbootin allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions without burning a CD. It runs on both Windows and Linux. You can either let UNetbootin download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you've already downloaded one or your preferred distribution isn't on the list."

My comment:
The most famous one.
Name: MultiSystem
Platform: Linux

Summary:
"Multisystem enables a LiveUSB to do everything, ideal for exploring different Linux distributions without installing on your PC, and it seamlessly; or to install the Linux distribution of your choice on your PC much faster than via a LiveCD with fast USB 2.0 ports Essential throughout the current range of netbooks that have no CD drive."

My comment:
My favorite one. Love the ability to bundle multiple distros and had a GRUB menu as a selection to which distro to be use.
Name: Ubuntu Live USB creator
Platform: Linux

Summary:
"Ubuntu Live USB creator (usb-creator) is an official tool to create Live USBs of Ubuntu from the Live CD or from an iso image. The tool is by default included in all releases after Ubuntu 8.04, and can be installed on Ubuntu 8.04. A KDE frontend was released for Ubuntu 8.10, and is currently included by default in Kubuntu installations. To run the current version on Ubuntu or other distributions, enter either usb-creator-gtk or usb-creator-kde at the command line."

My comment:
First tool that I've used for the task.
Name: SARDU
Platform: Windows

Summary:
"Shardana Antivirus Rescue Disk Utility (Sardu) is software that can produce an ISO or an IMA anti-virus bootable CD, a comprehensive collections of utilities, the most popular distributions of Linux Lite, and the best known Windows PE. It is freeware (it is licensed as an individual ISO / IMA). Once the files are extracted Sardu creates a CD / DVD or USB bootable device with a handy menu divided into four categories: Antivirus, Utilities, Linux, and PE."

My comment:
Seems to me this is the best tool available on Windows platform. You can also have the recovery disk for XP, Vista, Seven or XP (64bit, Professional or Home) in a practical multi-boot menu. Definitely going to try with this one.
Name: Universal USB Installer
Platform: Windows

Summary:
"Universal USB Installer is a Live Linux USB Creator that allows you to choose from a selection of Linux Distributions to put on your USB Flash Drive. The Universal USB Installer is easy to use. Simply choose a Live Linux Distribution, the ISO file, your Flash Drive and, Click Install."

My comment:
An option for Windows user. One Distribution can be installed at any given point in time.
Name: MultiBoot USB
Platform: Windows

Summary:
"MultiBootISOs enables each user to create their own custom Multiboot UFD containing only the Distributions they want. New Distributions can be added to your UFD each time the tool is run."

My comment:
Same feature as MultiSystem but for Windows user. One thing that attract me to this tool was the ability to put Windows Vista / 7 installation disk into the USB. I haven't try this one yet.

Update (02/04/2011)
Tested the tools for Windows platform. Personally I would say SARDU is the best tool available for Windows.

Monday, March 7, 2011

PowerShell cmdlet aliases similar to Bash...

CmdLet Alias Bash
Get-ChildItem gci, dir, ls ls
Get-Content gc, type, cat cat
Get-Command gcm which
Get-Help help, man man
Clear-Host cls, clear clear
Copy-Item cpi, copy, cp cp
Move-Item mi, move, mv mv
Remove-Item ri, del, erase, rmdir, rd, rm rm, rmdir
Rename-Item rni, ren, mv mv
Get-Location gl, pwd pwd
Pop-Location popd popd
Push-Location pushd pushd
Set-Location sl, cd, chdir cd
Tee-Object tee tee
Write-Output echo, write echo
Get-Process gps, ps ps
Stop-Process spps, kill kill
Select-String n/a grep
Set-Variable sv, set set

Copied from Wikipedia.

Wednesday, March 2, 2011

Compacting/Shrinking virtual disk image...

Working on virtual machine with dynamic virtual disk gives an advantage to those with limited disk space. But after using it for a while (install/uninstall/copy/paste/delete), the actual size of your virtual disk image may have grown to nearly defined size, guest system reported that the disk usage was less than the size reported on host system. It should be fine provided if you have larger disk space. However, if that's not the case, than the best option would be to compact (known as shrink in VMWare) the virtual disk image.

In general, 3 steps are required to achieve this task
1) Disk cleanup / Defrag the hard drive on guest system

2) Execute "sdelete -c" to zero the free disk space before compressing the virtual disk image (sdelete tool was provided by Microsoft) on guest system
> sdelete -c [drive letter]
3) Compact the virtual disk image

VirtualBox user
Execute VBoxManage command on host system
$ VBoxManage modifyhd [filename] --compact
VMWare user
Shrinking needs to be done on guest system. Complete the first two steps above then:
1) Open VMWare tools by right click VM icon in system tray

2) Go to Shrink tab, under supported partitions, check the mount point checkbox

VMWare Tools Properties


3) Click "Prepare to shrink" and once ready, click "Yes" to proceed

Preparing shrink process


Ready to go


Shrinking in progress


If everything working as expected, virtual disk usage on both guest and host should be ~same

Note:
Test environment
Host: Linux Mint 10 64-bit
VirtualBox guest: Windows Server 2003 32-bit
VMWare guest: Windows 7 Profesional 64-bit

Wednesday, February 23, 2011

Dexpot, undoubtedly the best virtual desktop solution for Windows...

When first introduced to Linux, things that excited me most are virtual desktop and semi transparent terminal. However due to my lack of knowledge on Linux makes me a person who wish that one day these features will be available on Windows.

Fast forward nine years later. Things that makes me eager to learn Linux again was virtual desktop (this time with cube via compositing window manager) and an alternative solution to avoid virus. Now I'm a Linux user at home. For work however, I'm still bond to Windows.

Used to worked in a company that provide me desktop with dual 19" widescreen monitor makes me a happy camper for Windows. Unfortunately, at my current working place I've been given a laptop with 13.3" screen. Struggling for months adjusting my eyes to the small desktop working area.

Desperately looking for virtual desktop solution for Windows (freeware). Came across to VirtualWin and mDesktop. A powerful tools and sufficient enough to do the job. However after using it for couple of months, it felt like I'm back in 90s where 4 boxes act as a deskstop switcher.

I want something similar to modern Linux. Something with animation. Google for best virtual desktop managers and found Dexpot. Finally, a dream come true (though not officially came from Microsoft, but who cares...). Virtual desktop manager for Windows with cube and wall effect as plugins. Not as perfect as Compiz on Linux but I'm happy with it on Windows.

Desktop Cube


SevenDex


Desktop Preview


Plugins and Extras settings


The sheer number of options can be a little overwhelming, but they are all neatly organized in a way that best befits this tool. You can setup shortcuts (but the defaults of Alt-1, Alt-2, etc. are about as fast and convenient as shortcuts get).

Information
Current version: 1.5.8 Build 1434
Download size: 3.89 MB
Release date: December 13th 2010
Platform: Windows 2000/XP/2003 and Vista/2008/7 (incl. x64)

Sunday, February 20, 2011

How to rip an mp3 audio from YouTube video...

Packages required, ffmpeg and libavcodec-extra-52
$ sudo apt-get install ffmpeg libavcodec-extra-52
The easiest way is to run the command below. Note that -ab is an option for audio bitrate
$ ffmpeg -i uverworld.flv -ab 192k uverworld.mp3
If you prefer GUI, you can use VLC. Below is a step by step screenshots

Click save item in playlist


Select mp3 profile and click Start button


If you want to change audio bitrate, click edit profile button, set bitrate, Save changes and Start the process


Note:
Tested on Linux Mint 10 64-bit.

Monday, February 14, 2011

How to download YouTube videos on Linux...

Package required, youtube-dl
    $ sudo apt-get install youtube-dl
Command to download
    $ youtube-dl [options] video_url
If you're getting an error as "ERROR: unable to download video (format may not be available)", get latest version of youtube-dl from github.

Set execute permission
    $ chmod +x youtube-dl-latest
Execute the latest version script to download video
    $ ./youtube-dl-latest [options] video_url
Note:
Tested on Linux Mint 10 64-bit.

Update (13/03/2011)
Found out an easy way. Install video download helper addon for Mozilla Firefox. Works perfectly on both Linux and Windows.

Saturday, February 12, 2011

*NSync Linux and Robocop Windows...

A command line to copy a folder while excluding some of it subfolders
rsync (brain mapping to nsync) in Linux
    rsync -IrW --stats --exclude=.svn /path/to/project/dir/ //testsrv/whatever
robocopy (brain mapping to robocop) in Windows
    robocopy \path\to\project\dir \\testsrv\whatever /MIR /XD .svn
copied from Rizal's blog post.

Tuesday, November 23, 2010

Mike Galbraith's Linux kernel patch that does wonders...

Last week I came across a blog post "The Linux desktop may soon be a lot faster" by Steven J. Vaughan-Nichols. It's about the patch done by Linux kernel developer Mike Galbraith who adds a mere 233 lines of code to the kernel's scheduler that cuts desktop latency down by a factor of ten. Even Linus Torvalds himself praised the performance boost he gets from the patch.

Two days later, another post appear on Google News. Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away by Andrew. Lennart Poettering, a RedHat developer replied to Linus Torvalds on a maling list with an alternative to this patch that does the same thing yet all you have to do is run 2 commands and paste 4 lines in your ~/.bashrc file.

Everybody seems excited with the improvement. As for the champ at the bit, they've started implement the workaround and I believe some even recompile the kernel with the patch. Wow!!!