Archive for the ‘Debian-Testing’ Category:

Google search terms to find interesting stuff on Google Drive.

To find a lot of interesting stuff on Google Drive, Google Dorks can be of assistance. Various search terms can find interesting files and information that people have stored on their Google Drive.

This is the search term: site:drive.google.com [your search term] -“Whoops!”.
How to find new open directories: http://palined.com/search/ or http://www.filechef.com/, search for what you’re looking for, though sometimes you get better results by leaving the filetype on default (Palined) and Other (Filechef). (The -“Whoops!” gets rid of the results that are removed because of Google’s Terms of Service.)

Here is an example. Searching for Linux stuff on Google Drive.

site:drive.google.com linux -"Whoops!"

I found this Google Drive containing a lot of themes and Linux files.

https://drive.google.com/folderview?id=0B3DsklBZ0EX0djVKNUdCVl9wd28&usp=drive_web.

Find Hollywood movies on the largest repository of pirated material ever.

site:drive.google.com "yify" -"Whoops!"

There are about 73,000 results for this search. Seriously a lot of free pirated movies on Google`s hosting service.

A similar search to find ISO images.

site:drive.google.com "iso" -"Whoops!"

About 256,000 results.

A search looking for information about the Linux shell.

site:drive.google.com "linux shell" -"Whoops!"

Google search term to find putty logfiles that could contain passwords or other information.

filetype:log username putty

I found one here with a Cisco router config in it.

https://supportforums.cisco.com/sites/default/files/legacy/1/1/2/2211-putty.log.

Fixed the PHP date code.

I have fixed my PHP date code, major facepalm when I had a default date hardcoded in the PHP…

OCP facepalm.

OCP facepalm.

Should be all good now.

Ubuntu 16.04 sources.list file. Might be useful.

This sources.list file might be useful for an Ubuntu desktop user who has overwritten their file and needs a new one.

## SOURCES LIST FOR UBUNTU 16.04 LTS XENIAL XERUS
## ALSO FOR XUBUNTU 16.04, LUBUNTU 16.04
## AND KUBUNTU 16.04
## From: http://sites.google.com/site/easylinuxtipsproject
## This list is for the Main server; you might want to select a
## faster mirror server closer to you, with Software & Updates.
## Only fit for 16.04 LTS Xenial Xerus!
#
## SOURCES FOR ORDINARY UPDATES AND SOFTWARE:
deb http://archive.ubuntu.com/ubuntu xenial main
deb http://archive.ubuntu.com/ubuntu xenial-updates main
deb http://archive.ubuntu.com/ubuntu xenial restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
#
## SOURCES FOR SECURITY UPDATES:
deb http://archive.ubuntu.com/ubuntu xenial-security main
deb http://archive.ubuntu.com/ubuntu xenial-security restricted
deb http://archive.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
#
## BACKPORTS SOURCES (WITH LOWERED PRIORITY):
deb http://archive.ubuntu.com/ubuntu xenial-backports main
deb http://archive.ubuntu.com/ubuntu xenial-backports restricted
deb http://archive.ubuntu.com/ubuntu xenial-backports universe
deb http://archive.ubuntu.com/ubuntu xenial-backports multiverse
#
## PARTNER SOURCE (FOR SOFTWARE FROM
## PARTNERS OF CANONICAL):
deb http://archive.canonical.com/ubuntu xenial partner

Put this in the sources.list file and run sudo apt-get update. An easy way to fix these problems. I had the wrong sources.list file, but this is how I fixed it.

Secret easter eggs in Linux software.

There are a few Linux easter eggs out there.

VIM Douglas Adams quote.

VIM Douglas Adams quote.

The above screenshot shows the Douglas Adams quote in VIM. Type :42 in the command mode to get this quote.

The apt-command for Ubuntu, Debian and Mint has had an embedded easter egg for quite a while.

If you type the help command for apt-get, you will get a hint:

apt-get help
 
. . .
. . .
  -c=? Read this configuration file
  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
                       This APT has Super Cow Powers.

Type this command to see a cool cowsay styled message.

[jason@darknet:~/Videos] apt-get moo
                 (__) 
                 (oo) 
           /------\/ 
          / |    ||   
         *  /\---/\ 
            ~~   ~~   
..."Have you mooed today?"...

Aptitude also has a cool easter egg…

ubuntu ~ $ aptitude -vvvvv moo
All right, you win.
 
                               /----\
                       -------/      \
                      /               \
                     /                |
   -----------------/                  --------\
   ----------------------------------------------

There is a cool easter egg in the nmap command, this prints the output as l33t script kiddie style.

ubuntu ~ $ nmap -6 -oS - ::1
 
$tarting Nmap 6.40 ( httP://nmap.0rg ) at 2016-04-20 03:32 utc
Nmap $can r3port for IP6-LocAlh0$t (::1)
H0ST |z up (0.00023s Lat3ncy).
N0T $hOwn: 998 CL0sed pORt$
P0RT   $TATe $eRv!C3
22/TCP OpeN  s$h
80/Tcp opEn  http
 
Nmap dOne: 1 !P adDrE$z (1 h0$t Up) $cAnnED in 0.05 sEcOnDs

fortune stegosaurus.

ubuntu ~ $ fortune | cowsay -f stegosaurus
 _________________________________________
/ Knucklehead: "Knock, knock" Pee Wee:    \
| "Who's there?" Knucklehead: "Little ol' |
| lady." Pee Wee: "Liddle ol' lady who?"  |
| Knucklehead: "I didn't know you could   |
\ yodel"                                  /
 -----------------------------------------
\                             .       .
 \                           / `.   .' "
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'  O    \     /               /       \  "
     (_____,    `._.'               |         }  \/~~~/
      `----.          /       }     |        /    \__/
            `-.      |       /      |       /      `. ,~~|
                ~-.__|      /_ - ~ ^|      /- _      `..-'
                     |     /        |     /     ~-.     `-. _  _  _
                     |_____|        |_____|         ~ - . _ _ _ _ _>

Make a train roll across your screen.

ubuntu ~ $ sl

Another secret easter egg in VIM.

Type: :Ni! in the VIM command mode to get this easter egg.

A shrubbery.

A shrubbery.

Create aliases with the Linux command line to make commands easier to remember.

Creating an alias for bash makes remembering a command easier. This is how longer commands may be simplified.

Here is an example.

[jason@darknet:~] alias lseasy='ls -lAhF'

This is the output.

[jason@darknet:~/Videos] lseasy                                     
total 4.8G
-rw-r--r-- 1 jason jason   18 Mar 24 13:34 authrootseq.txt
-rw-r--r-- 1 jason jason  23K Mar 24 13:55 heap2.htm
-rw-r--r-- 1 jason jason  893 Mar 24 13:48 heap.html
-rw-r--r-- 1 jason jason  23K Mar 24 13:54 java.js
-rw------- 1 jason jason 624M Aug 17  2013 Microsoft.Windows.XP.Professional.SP3.x86.Integrated.August.2013.iso
-rw------- 1 jason jason 2.3G Jan 17 15:42 Pixels.2015.mp4
-rw------- 1 jason jason 331M Mar 17  2015 s13l43-the-subnet-maskmp4.mp4
-rw------- 1 jason jason 371M Mar 17  2015 s13l44-the-diagram-we-use-to-subnet-how-to-use-the-diagram-for-our-needsmp4.mp4
-rw------- 1 jason jason 180M Mar 17  2015 s13l45-class-full-subnettingmp4.mp4
-rw------- 1 jason jason 458M Mar 17  2015 s13l46-class-less-subnettingmp4.mp4
-rw------- 1 jason jason 413M Mar 17  2015 s13l47-route-summarizationmp4.mp4
-rw------- 1 jason jason 174M Mar 17  2015 s13l48-wildcard-maskingmp4.mp4
-rw-r--r-- 1 jason jason   33 Mar 24 09:40 windows-sp3-xp-key.txt

Run the alias command by itself to get a listing of the available aliases on your system for your current user.

jason@darknet:~/Videos] alias 
lseasy='ls -lAhF'
run-help=man
which-command=whence

It is also possible to specify parameters in an alias command.

jason@darknet:~/Videos] alias letc='ls -al /etc'

This of course works a treat.

[jason@darknet:~/Videos] letc                         
total 32
drwxr-xr-x   2 root root  4096 Apr  6 15:56 .
drwxr-xr-x 193 root root 12288 Apr 20 09:58 ..
-rw-r--r--   1 root root   220 Nov 13  2014 .bash_logout
-rw-r--r--   1 root root  3391 Apr  6 15:56 .bashrc
-rw-r--r--   1 root root  3526 Dec  2 20:34 .bashrc.original
-rw-r--r--   1 root root   675 Nov 13  2014 .profile

Aliases are a very useful Linux tool, making long and complex one-liners easy to use and remember.

Windows 10 bash shell not very impressive at all.

The new Windows 10 bash shell is not very impressive once you get it installed. I have tried it and I could not ping websites even though Microsoft Edge could access the Internet. It is possible to install packages if these lines are added to the /etc/hosts file.

91.189.91.14 archive.ubuntu.com
91.189.92.201 security.ubuntu.com

But using ping does not work. I cannot even add a static route with the ip route add command. Microsoft really need to fix this. I would use this if I could use links or lynx to browse Slashdot in a CMD window on a Windows 10 desktop. But since I have Debian Jessie installed on my laptop with the Kali Linux package repositories merged in, it is a little redundant. There is a big fuss about the Windows 10 bash shell, but it needs a lot of work before it is even usable. In a Virtual Machine in VMware running on a computer with 12 Gigabyes of RAM with 4 Gigabytes devoted to the VM, it keeps stopping and I have to press ENTER to keep an operation going like an APT update. I have no idea why this is. Better to run Debian Jessie in a VM and SSH into it and get a bash shell on your desktop that way.

Linux has come a long way since the early days, now I can run a Linux shell on my Android phone that supports apt-get. But the Microsoft alternative is quite underwhelming. A pity, it promised so much but is delivering so little. There are so many reports of Internet connectivity issues: https://github.com/Microsoft/BashOnWindows/issues/5. Why can they not fix this? Offer a generic network driver that is always connected to the host using NAT and allows Internet access? If your machine was behind a proxy, adding proxy information to /etc/apt/apt.conf would be required, but this should work fine. Possibly they need to virtualise a network connection and always allow Internet access. If the CMD and Powershell windows can access the Internet why not the Debian Linux bash shell? Although Microsoft have apparently not yet implemented ICMP sockets. This is why ping does not work.

One person suggested disabling the Windows Firewall completely and this fixed the problems they were having, but this would be a bad thing. Once the problems are sorted out, this might actually be a useful tool, but not yet.

How to get weather information with curl on Linux.

The curl command on Linux may be used to get weather information from the Internet. The curl wttr.in/"new york" command will retrieve weather information from wttr.in.

[jason@darknet:~] curl wttr.in/"new york"
Weather for City: New York, United States of America
 
     \   /     Clear 
      .-.      68 °C       
   ― (   ) ―   ↓ 9 km/h       
      `-’      16 km          
     /   \     0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Thu 14. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│      .-.      47 °C       │      .-.      1013 °C     │      .-.      2022 °C     │      .-.      15 °C          │
│   ― (   ) ―   ↓ 1315 km/h │   ― (   ) ―   ↓ 1214 km/h │   ― (   ) ―   ↙ 23 km/h   │   ― (   ) ―   ↖ 910 km/h  │
│      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Fri 15. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│    \  /       Partly Cloudy  │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│  _ /"".-.     56 °C       │      .-.      1215 °C     │      .-.      2123 °C     │      .-.      16 °C          │
│    \_(   ).   ↓ 59 km/h   │   ― (   ) ―   ↙ 1213 km/h │   ― (   ) ―   → 12 km/h   │   ― (   ) ―   ↘ 5 km/h       │
│    /(___(__)  10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│               0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sat 16. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │
│      .-.      911 °C      │      .-.      1113 °C     │      .-.      2022 °C     │      .-.      16 °C          │
│   ― (   ) ―   ↓ 1011 km/h │   ― (   ) ―   ↓ 1618 km/h │   ― (   ) ―   ↓ 1011 km/h │   ― (   ) ―   ↖ 78 km/h   │
│      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 
Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

The weather information for Sydney is also available.

[jason@darknet:~] curl wttr.in/"sydney"  
Weather for City: Sydney, Australia
 
     \   /     Sunny
      .-.      2526 °C     
   ― (   ) ―   ↙ 24 km/h      
      `-’      10 km          
     /   \     0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Fri 15. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │     \   /     Clear          │
│      .-.      2021 °C     │      .-.      2223 °C     │      .-.      22 °C          │      .-.      19 °C          │
│   ― (   ) ―   ↓ 1213 km/h │   ― (   ) ―   ↙ 1619 km/h │   ― (   ) ―   ↓ 2124 km/h │   ― (   ) ―   ↓ 1528 km/h │
│      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sat 16. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │  _`/"".-.     Patchy rain ne…│  _`/"".-.     Light rain sho…│
│      .-.      2122 °C     │      .-.      2425 °C     │   ,\_(   ).   21 °C          │   ,\_(   ).   20 °C          │
│   ― (   ) ―   ↘ 910 km/h  │   ― (   ) ―   ↙ 911 km/h  │    /(___(__)1728 km/h │    /(___(__)2033 km/h │
│      `-’      10 km          │      `-’      10 km          │      ‘ ‘ ‘ ‘  10 km          │      ‘ ‘ ‘ ‘  10 km          │
│     /   \     0.0 mm | 0%/   \     0.0 mm | 0%    │     ‘ ‘ ‘ ‘   0.1 mm | 83%   │     ‘ ‘ ‘ ‘   0.4 mm | 83%   │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sun 17. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│  _`/"".-.     Light rain sho…│  _`/"".-.     Patchy rain ne…│      .-.      Light rain     │  _`/"".-.     Light rain sho…│
│   ,\_(   ).   20 °C          │   ,\_(   ).   2225 °C     │     (   ).    19 °C          │   ,\_(   ).   13 °C          │
│    /(___(__)2632 km/h │    /(___(__)3034 km/h │    (___(__)1437 km/h │    /(___(__)2130 km/h │
│      ‘ ‘ ‘ ‘  10 km          │      ‘ ‘ ‘ ‘  10 km          │     ‘ ‘ ‘ ‘   7 km           │      ‘ ‘ ‘ ‘  10 km          │
│     ‘ ‘ ‘ ‘   0.4 mm | 55%   │     ‘ ‘ ‘ ‘   0.1 mm | 33%   │    ‘ ‘ ‘ ‘    1.0 mm | 100%  │     ‘ ‘ ‘ ‘   1.8 mm | 75%   │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 
Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

A very good thing to show in a spare xterm on your desktop.

It is also possible to get weather using a 3 letter airport code. This is for Heathrow airport.

[jason@darknet:~] curl wttr.in/lhr

A domain name may also be used as a location!

[jason@darknet:~] curl wttr.in/@rivers.com.au
Weather for City: Rosebery, Australia
 
     \   /     Sunny
      .-.      2729 °C     
   ― (   ) ―   → 11 km/h      
      `-’      10 km          
     /   \     0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Fri 15. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│    \  /       Partly Cloudy  │     \   /     Sunny          │     \   /     Clear          │     \   /     Clear          │
│  _ /"".-.     25 °C          │      .-.      2729 °C     │      .-.      2527 °C     │      .-.      21 °C          │
│    \_(   ).   ↓ 68 km/h   │   ― (   ) ―   → 1113 km/h │   ― (   ) ―   ↗ 1123 km/h │   ― (   ) ―   ↑ 1730 km/h │
│    /(___(__)  10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│               0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sat 16. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │    \  /       Partly Cloudy  │               Cloudy         │     \   /     Clear          │
│      .-.      20 °C          │  _ /"".-.     2325 °C     │      .--.     19 °C          │      .-.      15 °C          │
│   ― (   ) ―   ↑ 1922 km/h │    \_(   ).   ↑ 2428 km/h │   .-(    ).   ↑ 1830 km/h │   ― (   ) ―   ↖ 2335 km/h │
│      `-’      10 km          │    /(___(__)  10 km          │  (___.__)__)  10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%0.0 mm | 0%0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sun 17. Apr ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │     \   /     Sunny          │     \   /     Clear          │     \   /     Clear          │
│      .-.      1314 °C     │      .-.      19 °C          │      .-.      17 °C          │      .-.      1314 °C     │
│   ― (   ) ―   ↖ 1820 km/h │   ― (   ) ―   ↖ 1214 km/h │   ― (   ) ―   ↑ 613 km/h  │   ― (   ) ―   ↖ 1021 km/h │
│      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%/   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 
Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

Windows 10 bash shell 10.0.14316 very good for getting system information.

The new bash shell in Windows 10 build 10.0.14316 is the best addition to Windows 10 yet. Here I am getting information about the CPU.

root@localhost:/mnt/c/Users/johnc# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
stepping        : 3
microcode       : 0xffffffff
cpu MHz         : 3399.000
cache size      : 256 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave osxsave avx f16c rdrand hypervisor
bogomips        : 6798.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

The networking does not work with this shell, so you cannot install any programs or ping websites, but the prompt is useful for using various commands. I am not sure why, there is no networking device available to create a static route. I have entered values into the /etc/resolv.conf, but this useless with no networking support. So you could not use the Lynx browser in a CMD window to browse Slashdot. But if the user has VMware, then Debian Jessie could be installed and this used to access a Linux command prompt.

The vmstat command is there, but the /proc filesystem is not working.

But I can use the lscpu command to get CPU information.

root@localhost:/mnt/c/Windows# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 60
Stepping:              3
CPU MHz:               3399.000
BogoMIPS:              6798.00
Hypervisor vendor:     VMware
Virtualization type:   full

Even piping works.

root@localhost:/mnt/c/Windows# lsof | grep txt
init      1 root  txt       REG    0,0   22856 1407374883651976 /init
bash      2 root  txt       REG    0,0 1021112 1125899906944571 /bin/bash
lsof     81 root  txt       REG    0,0  163224  562949953616850 /usr/bin/lsof
grep     82 root  txt       REG    0,0  191952 1125899906944574 /bin/grep
lsof     83 root  txt       REG    0,0  163224  562949953616850 /usr/bin/lsof

But not much else. Better to stick with a native Debian Jessie or Ubuntu 16.04 installation. This is shit without networking capability.

Windows 10 getting a Linux shell.

Windows 10 is getting a bash shell in the summer release. This is a couple of months away. But here are a couple of screenshots from developers I have found on the web that show what this will look like. Here a person is installing the bash shell using CMD.

Windows 10 bash shell installing.

Windows 10 bash shell installing.

Now this is the bash shell running.

Ubuntu bash shell running on Windows 10.

Ubuntu bash shell running on Windows 10.

This person is using a root prompt. The /proc filesystem is even in place, the systems administrator is even able to get information about the CPU using /proc/cpuinfo. This means that the admin could use existing UNIX shell scripts on Windows, instead of rewriting them for the Powershell scripting language. I cannot wait for this to be released to the general public so that I can get a hold of this. I tried updating Windows 10 to the fast ring and enabling developer mode, but this does not work yet, I will wait a few months until the “stable” build of Windows 10 X64 has this feature. Or you could just install Ubuntu 16.04 in a VMware VM and then SSH into it from Bitvise or Putty. Same thing really.

Apparently, the prompt will not have the ability to overwrite certain files on the filesystem.

Bash shell on Windows 10.

Bash shell on Windows 10.

I wonder if the bash shell supplied with this is vulnerable to shellshock…

Linux bash shell coming to Windows 10.

Apparently, the Linux bash shell is coming to Windows 10. This will offer a fully functional Linux bash prompt in the Windows app store, a good alternative to Powershell. This is in partnership with Canonical who work on the Ubuntu Linux distribution. As long as this offers tools such as dig, wget, and whois, it will be a very powerful tool for Windows system administration. A good thing to partner with Powershell, which has commands to start and stop Windows services and install features for Windows. This was announced at the Build Developer Conference. The Linux bash shell has been in Linux for a very long time, since 1989. It has extensive support for scripting and therefore is used in the Linux installation to automate many tasks. If this could be used in Windows 10 to script various administration tasks, it would be a good tool for any systems admin who is skilled in the Linux shell. Microsoft are embracing open-source software in a big way, I hope this is not an attempt to extinguish the competition, such as Red Hat Enterprise Linux, Fedora Server and Ubuntu server products.

Microsoft even have a Github account with quite a few open-source programs they have released, a huge list indeed. This is what they need to compete in the modern world, a lot of modern server tasks such as web hosting, file servers, printer servers and workgroups can be done on Linux with Apache and SAMBA. So Microsoft must adapt to compete with Linux and UNIX. If only they could improve the code-base of Windows, apparently, it is a huge mess in Windows 10. Pushing a massive code-base like Windows 10 with all sorts of code embedded together in the one operating system. If they could start a parallel project to start a whole new Windows operating system that would use a whole new code-base, that would be a very good project, but this would be very costly. I would love to see Microsoft take a risk and develop an entire Windows operating system from scratch. Redmond seem to be focused on the bottom line, getting the new Windows release out there, without worrying about whether it will work on all modern machines. Windows 10 does have Directx 12 coming, which will be used by the new Arma 3 Apex update, but I will stick with Windows 7 for a good while.

Windows 7 is still supported until 2020. This is still a few years away yet. And it is still getting updates. This is just like the Linux prompt you could install in Windows Server 2008 and 2003. This offered a csh shell that could run many Linux commands on a Windows Server PC. Microsoft Services for UNIX allowed this functionality.

How to build a 4.6 kernel on Ubuntu 16.04.

Firstly, download a kernel tarball from kernel.org.

jason@jason-desktop:~$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.6-rc1.tar.xz
--2016-03-29 10:22:34--  https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/linux-4.6-rc1.tar.xz
Resolving cdn.kernel.org (cdn.kernel.org)... 103.245.222.69
Connecting to cdn.kernel.org (cdn.kernel.org)|103.245.222.69|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 89423304 (85M) [application/x-xz]
Saving to: 'linux-4.6-rc1.tar.xz’
 
linux-4.6-rc1.tar.xz                  100%[======================================================================>]  85.28M  1.29MB/s    in 66s
 
2016-03-29 10:23:54 (1.28 MB/s) - 'linux-4.6-rc1.tar.xz’ saved [89423304/89423304]

Then unpack the kernel tarball.

jason@jason-desktop:~$ tar -xvf linux-4.6-rc1.tar.xz

Then copy an existing kernel configuration from your /boot folder to create a config for the menuconfig to use.

jason@jason-desktop:~/linux-4.6-rc1$ cp /boot/config-4.5.0-johnpc .config

Then run this command to setup the kernel.

jason@jason-desktop:~/linux-4.6-rc1$ make menuconfig

Then build the kernel and modules. I am connected to my machine over the Internet with SSH, so I will run this command in the background with NOHUP.

jason@jason-desktop:~/linux-4.6-rc1$ nohup make && make modules &

Once this has completed, install all of the modules to the /lib/modules directory.

jason@jason-desktop:~$ sudo make modules_install

Then install the kernel to the system.

jason@jason-desktop:~$ sudo make install

Now after all of this effort, we need to prepare the kernel source for installation.

jason@jason-desktop:~/linux-4.6-rc1$ sudo make clean prepare

The source code tree is copied to the /usr/src directory and symlinks created so that it looks like this.

jason@jason-desktop:~/linux-4.6-rc1$ ls -hula /usr/src/
total 36K
drwxr-xr-x  9 root  root  4.0K Mar 30 10:44 .
drwxr-xr-x 11 root  root  4.0K Mar 30  2016 ..
drwxrwxr-x 25 jason jason 4.0K Mar 22 11:16 linux-4.5
drwxrwxr-x 25 jason jason 4.0K Mar 30 10:44 linux-4.6-rc1
drwxr-xr-x 27 root  root  4.0K Jan 16 13:13 linux-headers-4.3.0-6
drwxr-xr-x  7 root  root  4.0K Jan 16 13:16 linux-headers-4.3.0-6-generic
drwxr-xr-x 24 root  root  4.0K Jan 16 13:07 linux-headers-4.3.3-gnu
drwxr-xr-x 27 root  root  4.0K Mar  4 18:42 linux-headers-4.4.0-9
drwxr-xr-x  7 root  root  4.0K Mar  4 18:42 linux-headers-4.4.0-9-generic
lrwxrwxrwx  1 root  root    18 Mar 30 10:44 linux-headers-4.5 -> /usr/src/linux-4.5
lrwxrwxrwx  1 root  root    22 Mar 30 10:44 linux-headers-4.6-rc1 -> /usr/src/linux-4.6-rc1

Then edit the symlinks in /lib/modules so they point to the proper source tree.

jason@jason-desktop:~/linux-4.6-rc1$ ls -hula /lib/modules/4.6.0-rc1-jason/
total 4.4M
drwxr-xr-x  3 root root  4.0K Mar 30 10:48 .
drwxr-xr-x  5 root root  4.0K Mar 30 10:38 ..
lrwxrwxrwx  1 root root    22 Mar 30 10:45 build -> /usr/src/linux-4.6-rc1
drwxr-xr-x 12 root root  4.0K Mar 29 13:18 kernel
-rw-r--r--  1 root root  1.1M Mar 29 13:18 modules.alias
-rw-r--r--  1 root root 1020K Mar 30  2016 modules.alias.bin
-rw-r--r--  1 root root  6.8K Mar 29 13:18 modules.builtin
-rw-r--r--  1 root root  8.5K Mar 30  2016 modules.builtin.bin
-rw-r--r--  1 root root  451K Mar 29 13:18 modules.dep
-rw-r--r--  1 root root  646K Mar 30  2016 modules.dep.bin
-rw-r--r--  1 root root   263 Mar 29 13:18 modules.devname
-rw-r--r--  1 root root  173K Mar 29 13:18 modules.order
-rw-r--r--  1 root root   114 Mar 30  2016 modules.softdep
-rw-r--r--  1 root root  460K Mar 29 13:18 modules.symbols
-rw-r--r--  1 root root  570K Mar 30  2016 modules.symbols.bin
lrwxrwxrwx  1 root root    22 Mar 30 10:45 source -> /usr/src/linux-4.6-rc1

And now re-boot into your brand new kernel!

Awesome Linux tricks and tips.

Convert a Linux text file to DOS format with AWK.

[jason@darknet:~] cat dodo-ip.txt | awk '{sub(/$/,"\r")};1' > dodo2.txt

Convert a DOS text file to UNIX format.

[jason@darknet:~] cat dodo2.txt | awk '{sub(/\r$/,"")};1' > dodo3.txt

Get your Internet facing IP address from the command line. This shows all information.

jason@jason-desktop:~/Documents$ curl ifconfig.me/all

Get just your Internet facing IP address.

jason@jason-desktop:~/Documents$ curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'

Print the IP address of your computer on the LAN.

jason@jason-desktop:~/Documents/ipinfo$ ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'
192.168.100.5

Print the ARP table of your machine.

jason@jason-desktop:~$ cat /proc/net/arp
IP address       HW type     Flags       HW address            Mask     Device
192.168.100.1    0x1         0x2         28:c6:8e:47:af:54     *        enp3s0

Another way to print the routing table for your LAN.

jason@jason-desktop:~$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.100.1   0.0.0.0         UG        0 0          0 enp3s0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 enp3s0
192.168.100.0   0.0.0.0         255.255.255.0   U         0 0          0 enp3s0

Get the current date and time in the terminal with the Linux command line.

jason@jason-desktop:~$ date
Tuesday 29 March  11:18:33 AEDT 2016

Get the current time and date from the Internet using the command line.

jason@jason-desktop:~$ date -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"
Tuesday 29 March  11:21:02 AEDT 2016

Count the number of entries in the /etc/passwd file.

jason@jason-desktop:~$ sudo awk -F: '{ print $1 }' /etc/passwd | wc -l
[sudo] password for jason:
42

Print the last 10 commands run on your machine.

jason@jason-desktop:~$ fc -l -10
879      date -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"
880      date
881      ps ax
882      cd
883      cd linux-4.6-rc1/
884      mc
885      psa x
886      ps ax
887      cd
888      sudo awk -F: '{ print $1 }' /etc/passwd | wc -l

Print a count of the files in a directory.

jason@jason-desktop:~$ echo "You have `ls | wc -l` files in `pwd`"
You have 18 files in /home/jason

Move the Unity launcher to the bottom of the screen with the new 16.04 release.

The new Ubuntu 16.04 release allows moving the Unity launcher to the bottom of the screen. This does make sense, screens are wider than they are tall, and I like having the bar on the bottom of the screen. Use the command below to move the bar to the bottom.

jason@jason-desktop:~$ gsettings set com.canonical.Unity.Launcher launcher-position Bottom

This command will move it back to the left of the screen.

jason@jason-desktop:~$ gsettings set com.canonical.Unity.Launcher launcher-position Left

This is a great way to make your Ubuntu Unity desktop look different. This is how it looks on a 1920×1080 screen.

Unity launcher on the bottom.

Unity launcher on the bottom.

How to format a new Linux partition with the command line.

This is how to format a hard disk partition that will hold data for your Linux system. The partition must be unmounted before formatting, but this is the ideal way to create a file-system on a new partition that has been created with fdisk.

root@jason-desktop:~# mkfs.ext4
mkfs.ext4     mkfs.ext4dev  
root@jason-desktop:~# mkfs.ext4 /dev/sdd3 
mke2fs 1.42.13 (17-May-2015)
/dev/sdd3 contains a xfs file system
Proceed anyway? (y,n) y
Creating filesystem with 57308349 4k blocks and 14327808 inodes
Filesystem UUID: 3c9ff4b7-0a4d-46bd-8499-238f66e1b840
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872
 
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Now I can list all of the partitions on the hard disk and see the one I have recently formatted.

root@jason-desktop:~# fdisk -l /dev/sdd
Disk /dev/sdd: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa8a8a8a8
 
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdd1            2048 390625279 390623232 186.3G 83 Linux
/dev/sdd2       450562048 518146032  67583985  32.2G 83 Linux
/dev/sdd3       518305792 976772588 458466797 218.6G 83 Linux
/dev/sdd4       390627326 450562047  59934722  28.6G  5 Extended
/dev/sdd5       390627328 406249471  15622144   7.5G 82 Linux swap / Solaris
/dev/sdd6       406251520 450562047  44310528  21.1G 83 Linux
 
Partition table entries are not in disk order.

Here I am mounting the new partition and it works.

root@jason-desktop:/mnt# mount /dev/sdd3 /mnt/lfsdisk/
root@jason-desktop:/mnt# cd lfsdisk/
root@jason-desktop:/mnt/lfsdisk# ls -huila
total 24K
      2 drwxr-xr-x 3 root root 4.0K Mar 26 12:27 .
8257537 drwxr-xr-x 4 root root 4.0K Mar 26 12:27 ..
     11 drwx------ 2 root root  16K Mar 26 12:09 lost+found

This is another way to list all block devices on the system.

root@jason-desktop:~# lsblk 
NAME   MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
sda      8:0    0    1.8T  0 disk 
└─sda1   8:1    0    1.8T  0 part /media/jason/Seagate Backup Plus Drive
sdb      8:16   0    1.8T  0 disk 
├─sdb1   8:17   0    100M  0 part 
└─sdb2   8:18   0    1.8T  0 part 
sdc      8:32   0    1.8T  0 disk 
├─sdc1   8:33   0 1002.3G  0 part 
├─sdc2   8:34   0  683.4G  0 part 
└─sdc3   8:35   0  177.3G  0 part 
sdd      8:48   0  465.8G  0 disk 
├─sdd1   8:49   0  186.3G  0 part 
├─sdd2   8:50   0   32.2G  0 part 
├─sdd3   8:51   0  218.6G  0 part 
├─sdd4   8:52   0      1K  0 part 
├─sdd5   8:53   0    7.5G  0 part 
└─sdd6   8:54   0   21.1G  0 part 
sde      8:64   0  298.1G  0 disk 
├─sde1   8:65   0  292.2G  0 part /
├─sde2   8:66   0      1K  0 part 
└─sde5   8:69   0      6G  0 part [SWAP]
sr0     11:0    1    4.2G  0 rom

Cracking a pin number hash with hashcat on Debian Linux.

I recently needed to crack a pin number hash that was four digits and used the numbers 2490. This sounds easy, but hard until you realise that it is a relatively simple PIN. I used the command below to generate a 60 Gigabyte wordlist, containing all possible combinations of the numbers in the PIN.

crunch 16 16 2490 -o pin.lst

Now I am cracking the PIN hash using my generated wordlist.

sudo hashcat -m 120 -a 0 -o cracked2 pin-hash.txt ../Documents/pin.lst -e salt

This was a successful crack as well. I used a 3.4 GHZ i7 Intel CPU and this cracked the PIN hash in no time.