Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Restart KDE5 plasma without logging out or rebooting

Restart KDE5 plasma without logging out or restarting the desktop environment (because of KDE5 Bugs? as great as KDE5 has been improved recently to KDE5 it still has a lot of bugs like if Krunner crashed and wont restart, want to restart KDE5 without logging out? or if you just need to restart for whatever reasons without logging or rebooting)


    Either Runs these commands in console:

    $ killall plasmashell & kstart plasmashell &

or a better way is to make a script (for example plasma_script) and make it executable and run it when you need to, with the content below:


#!/bin/bash

killall plasmashell
kstart plasmashell &

Clamav Linux Anti-virus

Clamav Linux Anti-virus
First Install Clamav:
Install clamav in Archlinux:
$ sudo pacman -Sy clamav
Install clamav in Slackware from a slackbuild script from slackbuilds.org
Install clamav in Debian:
$ sudo apt-get install clamav 
Install clamav in OpenSUSE:
$ zypper install clamav 
Check the clamav version:
$ clamdscan -V

Terminal Usage:

At first you have to update the virus definitions with:
# freshclam
Then you can scan for viruses.
# clamscan OPTIONS File/Folder 
If necessary start with root permissions: sudo clamscan.
Examples:
  • To check all files on the computer, displaying the name of each file:
    # clamscan -r /
    
  • To check all files on the computer, but only display infected files and ring a bell when found:
    # clamscan -r --bell -i /
    
  • To scan all files on the computer but only display infected files when found and have this run in the background:
    # clamscan -r -i / &
    
    Note - Display background process's status by running the jobs command.
  • To check files in the all users home directories:
    # clamscan -r /home
    
  • To check files in the USER home directory and move infected files to another folder:
    # clamscan -r --move=/home/USER/VIRUS /home/USER
    
  • To check files in the USER home directory and remove infected files (WARNING: Files will be removed):
    # clamscan -r --remove /home/USER
  • Another possibility is to move the infected files to another folder with the option --move=FOLDER, so you can later check which files of them maybe not infected or a virus.  example:  
    # mkdir -p home/USER/QUARANTINED && clamscan -r --move=/home/USER/QUARANTINED /home/USE
  • To see more options:  
     # clamscan --help 
     
To put all the infected files list on a particular file: 
# clamscan -r /path-to-folder-to-scan/ | grep FOUND >> /path-to-file/clamav-log.txt


Updating Clamav:

Update clamav in command line:

# freshclam 



Clamav Common Update Problems and Troubleshooting:


1.) If you get an error saying something like:

ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

The Fix is - Check file permissions and make clamav runnable with your user or better run it with sudo or as root


2.) If you get an error like this despite running as root or with sudo with freshclam update command:

ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
The Fix is - Delete the file ( /var/log/clamav/freshclam.log) with this command:
# rm -rf /var/log/clamav/freshclam.log

for a GUI for clamav, install clamtk (debian)


# apt-get install clamtk
Clamav Config Files: 
The Config file of clamav updater is in etc/clamav/freshclam.conf 
The Config file of the main clamav scanner is in /etc/clamav/clamd.conf

How to Burn a Bootable ISO Image to Disc in a Linux Terminal

How to Burn a Bootable ISO Image to Disc in a Linux Terminal:


There are many good free GUI apps to burn bootable linux iso images to disc in linux like k3b, brasero, xfburn and even the many free GUI burner apps for windows such as CdBurnerXP, ImgBurn, Infrarecorder, Active ISO Burner, BurnCDCC,  Free ISO Burner, ISOBurn, ISO Recorder, Passcape ISO Burner, ISO Workshop, Free Any Burn, Windows 7 Built-in Disc Image Burner etc etc, and even free linux CLI apps like cdrecord and many others, in this article however I will just mention 3 quick command line apps that are most common in linux distributions and mention an extra 4th choice, thats a menu driven linux CLI burning app for last

In the examples used here the default internal burner of the laptop is set as /dev/sr0, If your burner is not /dev/sr0, replace the device with the one your system uses.

Insert your blank CD/DVD/BD-R/RW then choose a method below


1.) wodim, issue command at terminal:

# wodim -v -eject -data -dao dev=/dev/sr0 speed=4 /path-to-bootable-linux-iso/foo.iso

- It is recommended to run wodim as root even if you can run it as a normal user to avoid errors and instability, read more about it in the notes below, and check the link provided there for further reading.
- For choosing Write Modes use DAO as primary choice or as a secondary choice use SAO for burning bootable ISO to disc, when using wodim anyways if you issue -dao as an option and for some reason its not possible to use DAO, wodim will automatically switch to using SAO, so to be safe just use the option DAO as -dao
- For wodim if the typical format of /dev/<foo> (/dev/sr0 here), doesnt work, issue the command:

# wodim  --devices

- A sample output of a laptop say for example with an internal DVD writer and another external USB DVD Writer drive plugged in will show:

wodim: Overview of accessible drives (2 found) :
-------------------------------------------------------------------------
 0  dev='/dev/sg1'    rwrw-- : 'HL-DT-ST' 'DVDRAM GUD0N'
 1  dev='/dev/sg4'    rwrw-- : 'Optiarc' 'DVD RW AD-7560S'
-------------------------------------------------------------------------

- Note how /dev/sr0 is referenced as /dev/sg1 with wodim and /dev/sr1 referenced as /dev/sg4 with wodim, but when you use lsblk command the output would show:

sr0     11:0    1  20.5M  0 rom
sr1     11:1    1  1024M  0 rom

- Both devices as /dev/sr0 as the internal laptop dvd writer and /dev/sr1 as the 2nd burner device as a usb plugged in external dvd writer
- So in this case if you want to use sr0 or sr1 devices for burning you can try:

(1st device, /dev/sr0)
# wodim -v -eject -data -dao dev=/dev/sg1 speed=4 /path-to-bootable-linux-iso/foo.iso

/or

(2nd device, /dev/sr1)
# wodim -v -eject -data -dao dev=/dev/sg4 speed=4 /path-to-bootable-linux-iso/foo.iso

- A sample verbose output of a successful DVD iso burn with wodim in terminal, using a gentoo linux live iso for example:

# wodim -v -eject -data -dao dev=/dev/sg1 speed=4 /home/lowfatdaemon/Downloads/Gentoo/livedvd-amd64-multilib-20160514.iso


TOC Type: 1 = CD-ROM
scsidev: '/dev/sg1'
devname: '/dev/sg1'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.36
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   :
Vendor_info    : 'HL-DT-ST'
Identification : 'DVDRAM GUD0N    '
Revision       : '1.00'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0011 (DVD-R sequential recording)
Profile: 0x0012 (DVD-RAM)
Profile: 0x002B (DVD+R/DL)
Profile: 0x001B (DVD+R)
Profile: 0x001A (DVD+RW)
Profile: 0x0016 (DVD-R/DL layer jump recording)
Profile: 0x0015 (DVD-R/DL sequential recording)
Profile: 0x0014 (DVD-RW sequential recording)
Profile: 0x0013 (DVD-RW restricted overwrite)
Profile: 0x0011 (DVD-R sequential recording) (current)
Profile: 0x0010 (DVD-ROM)
Profile: 0x000A (CD-RW)
Profile: 0x0009 (CD-R)
Profile: 0x0008 (CD-ROM)
Profile: 0x0002 (Removable disk)
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 294912 = 288 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size      : 12582912 = 12288 KB
Track 01: data  2839 MB      
Total size:     3261 MB (323:05.10) = 1453883 sectors
Lout start:     3261 MB (323:07/08) = 1453883 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 844613
Speed set to 5540 KB/s
Starting to write CD/DVD at speed   4.0 in real SAO mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Sending CUE sheet...
Starting new track at sector: 0
Track 01: 2839 of 2839 MB written (fifo 100%) [buf  60%]   3.9x.
WARNING: padding up to secsize.
Track 01: Total bytes read/written: 2977551360/2977552384 (1453883 sectors).
Writing  time:  594.333s
Average write speed   3.7x.
Min drive buffer fill was 55%
Fixating...
Fixating time:   35.103s
wodim: fifo had 46900 puts and 46900 gets.
wodim: fifo was 0 times empty and 26857 times full, min fill was 97%.

- Upon finishing the burning process, with the command using the option -eject, the system will automatically eject the disc, so you know its done.
- The successful iso burn result, was a bootable gentoo live DVD disc.


Troubleshooting Wodim:
- If  command "wodim  --devices" doesnt work or you get some error (being root), you can also try one of the following:

# wodim -scanbus

or 

# wodim dev=help --devices

- If you get issues or an error saying: cannot open SCSI driver, try using the command lsblk, and look for the corresponding rom devices, if you see sr(n) where n is a number like for example sr0 listed as rom, if so then, try using these commands:

# wodim dev=/dev/sr0 --devices 

or

# wodim dev=/dev/sr0 --scanbus

- If you get output similar to these below, from the above commands that means you're all good and the device/s work, just use the sr(n) label for devices in this case sr0 for burning:


wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
 0  dev='/dev/sr0'      rwrw-- : 'HL-DT-ST' 'DVDRAM GUD0N'
-------------------------------------------------------------------------

and

scsibus2:
        2,0,0   200) 'HL-DT-ST' 'DVDRAM GUD0N    ' '1.00' Removable CD-ROM
        2,1,0   201) *
        2,2,0   202) *
        2,3,0   203) *
        2,4,0   204) *
        2,5,0   205) *
        2,6,0   206) *
        2,7,0   207) *

- You can also check to see if your kernel has support for burning or the proper kernel modules are loaded, Use lsmod command to check for modules named "sr_mod" and "sg", issue command:

$ lsmod | grep sr_mod

and

$ lsmod | grep sg

- If it is built into kernel then check output command of dmesg.
- You could also check permissions for device at /dev/sr0, issue command:

$  ls -l /dev/sr0

- Make sure to be root user when using wodim, to avoid errors and complications

-----------------------------------------------------------------------------------------------------------------------------------------------------------

2.) geniosimage, issue command at terminal:

$ genisoimage -r -J -o /path-to-bootable-linux-iso/foo.iso /dev/sr0

-----------------------------------------------------------------------------------------------------------------------------------------------------------

3.) growisofs, issue command at terminal:

(for CD)

$ growisofs -speed=4 -use-the-force-luke=dao -Z /dev/sr0=/path-to-bootable-linux-iso/foo.iso

/or

(for DVD)

$ growisofs -speed=4 -dvd-compat -use-the-force-luke=dao -Z /dev/sr0=/path-to-bootable-linux-iso/foo.iso

- The -dvd-compat option is also used so that a complete lead-out is written to the media for maximum compatibility.
- The option -use-the-force-luke sets the write mode in this example DAO is used (and it is recommended for burning bootable ISO files to discs), as -use-the-force-luke=dao, see notes below for some information about write modes

-----------------------------------------------------------------------------------------------------------------------------------------------------------

4.) bashburn, install bashburn and run it in command line:

$ bashburn

- Go through the menus to edit configurations and burn your iso


-----------------------------------------------------------------------------------------------------------------------------------------------------------


Notes:
- Make sure the apps you use here are installed in your system, if not then install them the way you would as your other apps in your chosen linux distribution
- Before burning downloaded bootable linux ISO file make sure the ISO file has been verified with its indicated checksum, from the upstream source where you got it from
- When burning bootable linux iso to disc (or even any data like audio files), its better to use a slower burning speed, safe choices are speeds of 2 or 4, slow burning is less error prone and allows the burning process to be done correctly and puts less stress on the CPU, burn in slow speeds to avoid making coasters (useless discs or a non-rewritable disc whose burn failed for any reason and cannot be repaired.).
- About Write Modes 101 (TAO, DAO, SAO, RAW, IPW):

    Track-At-Once
    CD content is subdivided into consecutive sets of sectors known as tracks. In Track-At-Once (TAO) mode the laser stopped and restarted between each track. This delay causes transitional areas, known as pre-gaps between the tracks. These cannot be avoided, but recorders which support Variable-Gap Track-At-Once can adjust the size of the pre-gap to a minimum of 2 sectors (2/75 of a second).
    With most drives TAO mode is required for multi-session recording.

    Disc-At-Once
    In Disc-At-Once (DAO) mode disc contents are recorded in a single pass without stopping the laser. This allows data to be written to the the pre-gap areas to avoid them altogether.

    Session-At-Once
    In Session at Once (SAO) mode multiple sessions can be recorded and finalized on a single disc. The resulting disc can be read by computer drives, but sessions after the first are generally not readable by CD Audio equipment.
    In Wodim, the DAO and SAO modes are synonymous. While most drives require multi-session discs to be authored in TAO mode, Wodim also has support for creating multi-session discs in SAO mode, assuming the underlying disc drive supports this.

    Raw Mode
    Disc images of CD-ROMs can be created either in raw mode (extracting 2,352 bytes per sector independent of the sector mode) or by obtaining only the actual data in the sector (2,048/2,336/2,352/2,324 bytes depending on the sector mode).The file size of raw mode disc images is always a multiple of 2,352 bytes. When such disc images are written to an optical media in raw mode, the 2,352 byte sectors, which already include the synchronization pattern and possibly error detection and correction data, are written to the disc as they are.

    Packet Writing
    Incremental Packer Writing (IPW) allows optical discs to be used in a manner similar to a writable block devices, i.e. it allows files to be created, modified or deleted on demand. This is achieved by writing a series of short (32k-256k) tracks on the disk in packet mode. CD-R/RW discs can be formatted into such packets, and the kernel pktcdvd module (packet writing driver) buffers up writes to the disk and transparently handles erasing and rewriting a whole packet at a time.


*In short when burning bootable linux ISO to disc, especially if its a DVD ISO it is best to just use DAO or as a secondary use SAO if DAO is not in the choices available for you, for writing audio CDs and you want a gap in between songs, use TAO.
- It is recommended to run wodim as root, as it says in ("http://linux.die.net/man/1/wodim"), excerpt "In any case, the user running wodim needs read and write access to the particular device file on a Linux system. It is recommended to be root or install the application as suid-root, because certain versions of Linux (kernel) limit the set of SCSI commands allowed for non-root users. Even if usage without root identity is possible in many cases, some device drivers still may fail, show unexplainable problems and generally the problems become harder to debug. The risk for buffer-underruns is also increased. See the PROCESS SCHEDULING PRIORITY section below for more details. " I've actually tried using it on a non-root user and it does give errors and problems, to avoid coasters and wasting your time just run it as root user.
- If for some reason you can't eject it with the button on your cd/dvd drive, or you just want to eject with a terminal command, you can eject it with the following commands:

$ eject

/or (to eject a specific rom device, especially if you have several rom devices plugged in where your rom is sr0 here if it isnt, replace the device with the one your system uses.)

$ eject /dev/sr0


  Reference Links:
- "ftp://ftp.slackware.com/pub/slackware/slackware-current/isolinux/README.TXT"
- "https://www.freebsd.org/doc/handbook/creating-dvds.html"

How to find out what device name in /dev directory is my DVD/CD Writer/Burner in the Linux Terminal

How to find out what device name in /dev directory is my DVD/CD Writer/Burner in the Linux Terminal


Best 3 ways on how to find out what device name in /dev directory is your DVD/CD Writer/Burner in the Linux Terminal: 



1.) By checking /proc/sys/dev/cdrom/ , issue command in terminal:

        $ cat  /proc/sys/dev/cdrom/

        /or

        $ less  /proc/sys/dev/cdrom/

        /or

        $ more  /proc/sys/dev/cdrom/

- a sample output in a laptop can look like this (showing other data including other device functions and even the drive speed):

drive name:        sr0
drive speed:        24
drive # of slots:    1
Can close tray:        1
Can open tray:        1
Can lock tray:        1
Can change speed:    1
Can select disk:    0
Can read multisession:    1
Can read MCN:        1
Reports media changed:    1
Can play audio:        1
Can write CD-R:        1
Can write CD-RW:    1
Can read DVD:        1
Can write DVD-R:    1
Can write DVD-RAM:    1
Can read MRW:        1
Can write MRW:        1
Can write RAM:        1

- The device name is: sr0
- So the device is in /dev/sr0


2.) With lsblk, issue command in terminal:

$ lsblk

- a sample output in a laptop can look like this:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk
├─sda1   8:1    0   300M  0 part
├─sda2   8:2    0   128M  0 part
├─sda3   8:3    0 110.5G  0 part
└─sda4   8:4    0   900M  0 part
sr0     11:0    1   4.4G  0 rom
loop0    7:0    0   765M  1 loop /lib/live/mount/rootfs/filesystem.squashfs
zram0  254:0    0  1002M  0 disk
zram1  254:1    0  1002M  0 disk
zram2  254:2    0  1002M  0 disk
zram3  254:3    0  1002M  0 disk
zram4  254:4    0  1002M  0 disk
zram5  254:5    0  1002M  0 disk
zram6  254:6    0  1002M  0 disk
zram7  254:7    0  1002M  0 disk

- In the TYPE Column look for ROM, so the device name here is sr0
- So the device is in /dev/sr0


3.) With inxi, issue command in terminal, make sure to type is as you see it, that O in Optical has to be capitalized, or just copy and paste it:

$ inxi -d | grep Optical

- a sample output in a laptop can look like this:

Optical: /dev/sr0 model: HL-DT-ST DVDRAM GUD0N dev-links: N/A

- The device name is sr0, in /dev as /dev/sr0

Where Best to Put your Local User Scripts in a GNU/Linux system?

Where Best to Put your Local User Scripts in a GNU/Linux system?

In General its best to put it in /usr/local/bin/

If you have to ask then Don't use these directories to store your user scripts:

/usr/bin, /sbin and /bin

Leave them for package-managed executables.

If you need the script for all users on your system (but you can also use this for one user), stick it in /usr/local/bin/. An advantage to this is that the directory is already in your PATH so there is no need to edit files.

But it can also depend in who will use the scripts



It depends on who will use your script:

    Yourself only - $HOME/bin 
    You and other local users - /usr/local/bin
    Root only - /usr/local/sbin

That way you have your own scripts separated from the distribution-provided binaries.

Extract Files from Archived Tarballs at the Terminal in Linux

Extract Files from Archived Tarballs at the Terminal in Linux


Modern tar recognizes the format by itself! One command works with any supported compression method.

$ tar xf archive.tar.xz
$ tar xf archive.tar.gz

$ tar xf archive.tar.bz2

$ tar xf archive.tar



Adding a v will make the output verbose (ex: tar xvf or tar xfv actually the order doesnt really matter)


(Legacy Support: For the older versions for tar.gz its $ tar xvfz somefilename.tar.gz but still applicable though like it mentions above xf is enough in most cases)

For the Bunzip2 or bzip2 or bz2 or tar.bz2 file in a single step, add the j switch:

$ tar xfj somefilename.tar.bz2 or $ tar xvfj somefilename.tar.bz2

Take not that its using a lowercase j as a capital J is for a different option switch as mentioned below

$ tar -xJf file.pkg.tar.xz

(The -J is the flag that specifically deals with .xz files.)

(For basic unzipping)
$ unzip file.zip

or

(to extract to a certain directory)

$ unzip file.zip -d destination_directory/


In 7zip:

This command lists the contents of the zip:
$ 7z l zipfile.zip

This command extracts the contents of the zip:
$ 7z x zipfile.zip


To unrar, within the directory (the e option extracts):
$ unrar e foo_file.rar

To unrar to a specified directory:
$ unrar e foo_file.rar destination_directory/

To unrar with its own original directory structure
$ unrar x foo_file.rar

How to Change Ownership of a Directory in Linux

How to Change Ownership of a Directory in Linux:

- This  is the format for the command:
    # chown -Rv username:group directory
(-R switch is to make it recursive that means to change the permissions for all files and directories inside of the directory)
(-v switch makes it verbose, its optional)

For Example:

- Say your using semplice linux (a debian sid based distro) in a live session and used # apt-get source foo to download and unpack the source code of a package, then you notice that you cant access the files or change the contents of that folder, because in live sessions semplice uses luckyuser as the normal user and the usergroup as well for that user, but to use apt-get source you have to be root, therefor downloading source with apt-get will make that directory under the group ownership of root, and when you check
file details you will see it listed with root:root meaning root user on root group, while any file made with luckyuser is normal user

- So lets say the source package was emacs-defaults-46.1 it was also unpacked from the package.tar.xz, but you cannot change the contents of the directory in anyway, despite even trying to change user rights on it, you have to change the group ownership

- To do that you look at the emacs-defaults_46.1.tar.xz ownership it says root:root meaning it belongs to root user as owner and group, to change it you need to make it luckyuser:luckyuser, so issue the command:

(the command format is: # chown -R username:group directory)

# chown -Rv luckyuser:luckyuser emacs-defaults-46.1

- This changes ownership to luckyuser from root, now all the settings allowed to root is allowed to luckyuser user and group
- You can now edit the directory and all of its contents or even delete it completely



Enabling Normal Non-Root Users to Use Ping in Linux

Enabling Normal Non-Root Users to Use Ping in Linux
 

- Sometimes you just want to ping a remote site or server to test something like your connection:

$ ping google.com

- but get this error:
ping: icmp open socket: Operation not permitted

- However ping works for the root user, just not non root users. To enable ping for normal users, issue command below as root or use sudo:

# chmod u+s `which ping`

(Those are backticks not single quotes)
 
/or

# chmod u+s /bin/ping

- Now it should work.

Solution to Problematic Audio because of Pulseaudio

Solution to Problematic Audio because of Pulseaudio


Symptoms of Problematic Pulseaudio due to permission problem:

- Some or all audio doesn't work, youtube and other flash videos affected, may not play or may play but without audio whether embedded in a website or not

- Cannot restart pulseaudio with:

$ pulseaudio -D
/or
$ pulseaudio --start

as regular or super user, however pulseaudio should work and preferably on normal user, but the user
must be in the audio group

- Pulseaudio command output:

E: [pulseaudio] main.c: Daemon startup failed.

or

E: [pulseaudio] main.c: Daemon startup failed.
E: [pulseaudio] main.c: pa_pid_file_create() failed

or something similar but fails to start the pulseaudio daemon


Solution:

Delete the .config/pulse/ directory
Restart or reboot system
Pulseaudio will now start as regular user

at terminal:

$ cd ~
$ cd .config
$ rm -rf pulse/

Restart computer, everything should work.
A new pulse directory would have been automatically created in .config/ directory


Troubleshooting:

- If you prefer to not use pulseaudio you can just uninstall pulse and reinstall alsa to be sure
- If you prefer to use pulseaudio, you can also try to reinstall pulseaudio and alsa
- If those options above don't work, you can also try deleting asound.conf do: # rm -rf /etc/asound.conf
- Check alsamixer, to make sure the problem is not because of a setting that is just muted or misconfigured
   in terminal do: $ alsamixer
   anything labeled MM means its muted, toggle to enable/disable by highlighting them then press M
   press escape to exit, if the settings do not stay persistent, re-do the settings and then after exiting, in
   terminal do: # alsactl store
- If alsamixer is always mute on reboot despite doing the "# alsactl store" command, then just
  disable the module "module-device-restore" by editing the file /etc/pulse/default.pa, save, exit and reboot.



*Notes:

- Make sure your user is in audio group
- Tested working on Arch Linux

How to Install Linux into a USB Flash Drive

How to Install Linux into a USB Flash Drive:


My preferred way is to disk dump the linux iso contents to the drive by command line, but there are other automated ways to do it and with GUI, such as Unetbootin, Linux Live USB or if your using windows to make the linux live usb drive, I recommend Rufus or Win32DiskImager for (32 bit windows only) For those you can just start the program and follow the instructions, its quite easy, or you can install and use cygwin where you can use GNU/Linux tools like dd in windows.

To find out which device your flash drive is, you can use many ways I'll just mention 2 here, either use fdisk or lsblk at command line:

# fdisk -l
/or
$ lsblk

After determining which is your device

Issue the command, with a pseudo foo path to the file.iso, assuming the flash drive is in /dev/sdb for example

# dd if=/path-to/file.iso of=/dev/sdb bs=4M; sync  
/or

# dd if=/path-to/file.iso of=/dev/sdb bs=4M status=progress oflag=nocache,sync && sync

To make sure the process completes successfully, unmount the flash drive, before unplugging:

# umount /dev/sdb

How to Download a Remote Directory Recursively with wget

How to Download a Remote Directory Recursively with wget

How to Download Folders and Files Recursively within a Remote Directory with wget, Issue command:

$ wget -e robots=off --cut-dirs=3 --reject="index.html*" --no-parent --recursive --relative --level=1 --no-directories "https://url-here/path-to-folder"



Download Flash Videos from Video Streaming Sites like youtube with Linux Command Line Apps

Download Flash Videos from Video Streaming Sites like youtube with Linux Command Line Apps


1.) with youtube-dl:

$ youtube-dl -cit "youtube.com/url-here" 

- optional to download an entire playlist or channel, go to the desired playlist list or channel, and grab the url then paste in terminal:

$ youtube-dl -cit "youtube.com/playlist_url-here"

- optional to download a custom list of video files, create a plain text/txt file and place all the YouTube links that you wish to download there, for example yt_foo_list.txt

$ youtube-dl -a yt_foo_list.txt

- optional to download the sound/music of the video to mp3 only:

$ youtube-dl -cit --extract-audio --audio-format mp3 "youtube.com/url-here"

- optional to download a video in certain file type/resoluton format, use option "–list-formats" with the command

$ youtube-dl –list-formats "youtube.com/url-here" 

- it will show you a list of formats with a corresponding video/resolution format code, that you can download in, choose from them, then to download a preferred file format from the list, use the option "-f", if flv was in the list and you want to save the file in that format, you then issue command

$ youtube-dl -f 34 "youtube.com/url-here"

- where 34 is the video/resolution format code of flv, it will say in the available video formats list or the resolutions available of the same format, code will be mentioned at the left most side

- optional to download video in all available formats, issue command

 $ youtube-dl –all-formats "youtube.com/url-here" 


2.) with get-flash-videos:

$ get-flash-videos "youtube.com/url-here"


3.) with cclive:

$ cclive "youtube.com/url-here"


4.) with movgrab:

$ movgrab "youtube.com/url-here"

5.) with you-get

$ you-get "youtube.com/url-here"

- Display the information of a video without downloading:

$ you-get "youtube.com/url-here"

- Download multiple videos:

$ you-get "youtube.com/url-here/A" "youtube.com/url-here/B"

-  Force Re-download vidoes (This will overwrite any existing video or temporary file):
 
$ you-get -f "youtube.com/url-here/"

- Set the output directory for downloaded files:

$ you-get -o ~/Downloads you-get -f "youtube.com/url-here/"

- Use a specific HTTP Proxy for Downloading
(use this -y proxy.uku.im:8888 as option and proxy for downloading from youku.com):

$ you-get -x 127.0.0.1:8087 "youtube.com/url-here/"

- Disable any proxy use  --no-proxy:

$ you-get --no-proxy "youtube.com/url-here/"

- Watch a video in your own video players of choice, like vlc and mplayer, to avoid uneccessary Ads.

$ you-get -p vlc "youtube.com/url-here/"

/or

$ you-get -p mplayer "youtube.com/url-here/"


Notes:
- To use any of the mentioned apps, they must be installed first
- youtube-dl, get-flash-videos, cclive, movgrab and you-get work in other sites as well not just youtube, for instance youtube-dl actually supports video download from several other sites like Dailymotion, Google Video, Photobucket, Facebook, Yahoo, Metacafe, Depositfiles and few more similar sites
- To upgrade youtube-dl do: $ youtube-dl -U
- youtube-dl can download from chinese websites like youku.com, tudou.com but if it doesnt work try to upgrade it first, if it doesn't work, you can use the you-get console app instead which supports alot of websites including chinese websites and even including japanese websites like niconico

KDE4 Disable Disturbing Huge Taskbar Thumbnail Previews and Tooltips at the panel:

KDE4 Disable Disturbing Huge Taskbar Thumbnail Previews and Tooltips at the panel:

Click Kmenu, Go to Settings, Go to System Settings, Go to Desktop Effects, Go to All Effects, disable Taskbar Thumbnails, by unchecking its box, press Apply.


After this there will no longer be huge previews when you hover on apps opened at the taskbar/panel, but the huge tooltips still shows, disable this next.


KDE4 Disable Disturbing Huge Tooltips at the taskbar panel in KDE:

Click Kmenu, Go to Settings, Go to System Settings, Go to Workspace Behaviour, Go to Workspace, uncheck the box Show Informational Tooltips, press Apply.


After this there will no longer be huge tooltip/s when you hover on apps opened at the taskbar/panel.


How to restart KDE without rebooting/logging off from X

Restart KDE4:

- Press ALT+F2 to run Krunner
- Issue either command and press enter:

1.) plasma-desktop

or

2.) kbuildsycoca4 && kquitapp plasma-desktop && kstart plasma-desktop

Enable Firewall through IPtables in Linux

Use IPtables for a firewall:

Below is a generic sample firewall you can use for this article

- edit /etc/rc.d/rc.firewall
- paste this

#!/bin/sh
# iptables script generated 2012-09-30
# http://www.mista.nu/iptables
IPT="/usr/sbin/iptables"
# Flush old rules, old custom tables
$IPT --flush
$IPT --delete-chain
# Set default policies for all three default chains
$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -P OUTPUT ACCEPT
# Enable free use of loopback interfaces
$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT
# All TCP sessions should begin with SYN
$IPT -A INPUT -p tcp ! --syn -m state --state NEW -s 0.0.0.0/0 -j DROP
# Accept inbound TCP packets
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# SMTP
#$IPT -A INPUT -p tcp --dport smtp -m state --state NEW -s 0.0.0.0/0 -j ACCEPT
# HTTP
#$IPT -A INPUT -p tcp --dport http -m state --state NEW -s 0.0.0.0/0 -j ACCEPT
# HTTPS
#$IPT -A INPUT -p tcp --dport https -m state --state NEW -s 0.0.0.0/0 -j ACCEPT
# SSH
$IPT -A INPUT -p tcp --dport ssh -m state --state NEW -s 0.0.0.0/0 -j ACCEPT
# Accept inbound ICMP messages
$IPT -A INPUT -p ICMP --icmp-type 8 -s 0.0.0.0/0 -j ACCEPT
$IPT -A INPUT -p ICMP --icmp-type 11 -s 0.0.0.0/0 -j ACCEPT
# EOF


- save
- exit

- To start firewall at boot
# chmod +x /etc/rc.d/rc.firewall

- If you want to disable the firewall
# iptables -F

- To disable at boot time
# chmod -x /etc/rc.d/rc.firewall

Manually removing kernels and kernel modules

Manually removing kernels and kernel modules
(OPTIONAL WAY):

- /boot Contains all the kernel images
- They probably are named with version numbers. You need to be root ("su -") to delete them, and you can use the standard "rm"  
- The module directories are then located at /lib/modules/{kernel_version} , you can delete the ones you don't need there. Be careful not to delete the kernel and
modules you need of course

How to disable Nepomuk, Strigi and Akonadi in KDE4

How to disable Nepomuk, Strigi and Akonadi in KDE4


Disable Nepomuk, Strigi and Akonadi, which can and will cause many problems and crashes through CPU and RAM Hogging

- Go System Settings > Desktop Search > Basic Settings
and disable:

- Email Indexing
- Nepomuk File Indexer
- Nepomuk Semantic Desktop
then Apply

then > Indexing
and disable:

- Index Documents
- Index Audio
- Index Images
- Index Videos
- Index Source Code
then Apply


Navigate command line at your /home/user directory

Then edit - ~/.kde/share/config/nepomukserverrc
set this, save and exit:

[Basic Settings]
Start Nepomuk=false


Then edit - ~/.kde/share/config/kdedrc
set this, save and exit:

[Module-nepomuksearchmodule]
autoload=false


Then edit - ~/.config/akonadi/akonadiserverrc and set "StartServer" to false.
set this, save and exit

[QMYSQL]
StartServer=false


- Restart GNU/Linux

How to forcefully unmount a Linux disk partition

How to forcefully unmount a Linux disk partition


Even if one cannot find the opened processes running with that partition or with stale NFS error which prevents unmount

# umount -f /mnt

where /mnt is the mount point or the partition you want to unmount

Using memtester to test RAM in the OS, instead of using the POST BIOS Linux Memtest86

Using memtester to test RAM in the OS, instead of using the POST BIOS Linux Memtest86:

1.) Do check, how much memory is there:
# free -m 

2.) If the MAX memory is 8GB:
# memtester 8000MB

Troubleshooting Google Chrome in Linux, shockwave and flash crashes and will not load:



Troubleshooting Google Chrome in Linux, shockwave and flash crashes and will not load:

- Go to the plugins, in google chrome, look for the FLASH plugins, there should be 2 kinds the Official FLASH and the Google Chrome Flash
- Disable the Google Chrome Flash, and apply, restart the browser and it should work.