Thursday 27 July 2017

Ubuntu linux copy and paste from one nano file to another nano file

In console mode without a mouse use the following to copy and paste:
  1. Launch nano in multi-buffer mode (nano -F)
  2. CTRL-K cut the line you need. (As this cuts the line don't save this file when you are finished)
  3. CTRL-R to open a file into a new buffer (you can type the full path ie /etc/this.conf)
  4. CTRL-U to paste in the opened file

Set up Raspberry Pi 3 on Wifi using WPA Enterprise (WPA-ENT) using mschap or WPA-PSK


Step 1. Setup authentication info


(credit to chatchavan)
Now, you should check what type of authentication your network use.
  • Personal: Typical home router require one password to connect. (Keywords: WPA, WPA2)
  • Enterprise: If you use the enterprise network, e.g., eduroam at the university, you will have user name and password. (Keywords: PEAP, MSCHAPV2)
For security reason, we will create a hash of your password. This hash will be used in the configuration file for the authentication info. This avoids saving your password in plain text.
At the command prompt create a MD4 hash of one of your password by entering the following command, typing your password and pressing enter:
(read -s PASS && echo -n $PASS | iconv -t utf16le | openssl md4 > hash.txt)
This will create a file called hash.txt within this you will see something like:
(stdin)= c612f89cd9678868a69e93beecfa10b6
You will need the bit after the equals sign.

Now you can add proper authentication info in the file /etc/wpa_supplicant/wpa_supplicant.conf. Use the following command to launch nano editor to edit this file.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Here're what you should add (depending on the authentication type). Replace YOUR_NETWORK_NAMEYOUR_USER_NAMEYOUR_PASSWORD_HASH below. (Keep the quotation marks if present.) If you have multiple network configurations, you can also add multiple entries.
Personal authentication (WPA, WPA2)
network={
ssid="YOUR_NETWORK_NAME"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR_NETWORK_PASSWORD"
}
Enterprise authentication (MSCHAPV2)
network={
ssid="YOUR_NETWORK_NAME"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
identity="YOUR_USER_NAME"
password=hash:YOUR_PASSWORD_HASH
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}
For a thorough explanation about important keys in the settings, read [NetBeez's instruction].
Now, we have the authentication information ready.

Step 2. Ensure that the network interface use the authentication info

Here, you should edit /etc/network/interface. Find the section about wlan0 and replace it with one of the following configuration (again, depending on your authentication type).
Personal authentication (WPA, WPA2)
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Enterprise authentication (MSCHAPV2)
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
 pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
 post-down killall -q wpa_supplicant
Now, try bringing the network interface down and up again:
sudo ifdown wlan0
sudo ifup wlan0
The following error message should be ignored. It's a known bug upstream from Debian.
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
If there's no error, you should be able to see the wireless adapter connected with the following command
iwconfig
The output will show the SSID and other connection info.
wlan0     IEEE 802.11bgn  ESSID:"YOUR_NETWORK_NAME"  Nickname:""
          Mode:Managed  Frequency:2.457 GHz  Access Point: XX:XX:XX:XX:XX:XX   
          Bit Rate:72.2 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
You should check if you have an IP address with the following command:
ifconfig
The wlan0 entry should have an IP address, like the following.
...
wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX  
          inet addr:192.168.0.110  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:497 errors:0 dropped:32 overruns:0 frame:0
          TX packets:373 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:83237 (81.2 KiB)  TX bytes:60068 (58.6 KiB)
...
You should be able to ping Google.
sudo ping google.com

Wednesday 26 July 2017

Unable to map windows 10 to ubuntu samba share with \\hostname or \\fqdn ( system error 64 has occurred )


After migrating to Windows 10 one of the many issues I came across was being unable to map windows 10 to one of my ubuntu samba shares with \\hostname or a \\fqdn ( it was returning system error 64 has occurred and specified network name no longer available)

I found a fix by doing the following:


Start -> Settings -> Control Panel -> Administrative Tools -> Local Security Policy

Under Security Settings -> Local Policies -> Security Options

Set "Microsoft network client: Digitally sign communications (always)" to "Disabled"

Restart the computer

For reference: https://lists.samba.org/archive/samba/2011-April/162201.html

Unfortuantley whilst fixing one issue it highlighted another and that was not being able to communicate with one of my windows servers obviously requiring digital signing.

The root of the issue is that I am running Samba version 3.6.25, so I will update this to at least 4.3.11 as I know this works as per another Ubuntu server.

I will update this to confirm.

Thursday 11 April 2013

Error code: ssl_error_no_cypher_overlap ASDM cannot connect or will not start on Cisco ASA using Windows 7

This is to help anyone having problems with the initial ASDM download that according to Cisco should happen straight out the box, well as with a lot of Cisco's equipment it isn't always as friendly as the documentation says.

My particular problem occurred with version was ASA Version 8.6(1)2 and ASDM 6.6(1)

I tried with three machines Windows 7 32 bit, Windows 7 64 bit and Windows XP only the windows XP machine worked, atleast I knew at that point there is hope.

 I noticed that when connecting via the windows 7 box I would sometimes get the error message:
 Cannot communicate securely with peer: no common encryption algorithm(s).
(Error code: ssl_error_no_cypher_overlap)












At this point I had a good search around the internet and managed to find the following line of code in a forum:
ssl encryption rc4-md5 rc4-sha1 aes128-sha1 aes256-sha1 3des-sha1

After this was entered at the conf t prompt everything worked as it should.

I can only put this down to later browsers usings more advanced versions of encryption that were n't configured when ASA Version 8.6(1)2 was built.

I've since found another blog with a better explanation but I will leave this in place as I didn't find anything when trawling google originally and the more help out their the better as this gave me a bit of a headache and wasted a good few hours!

Thursday 18 February 2010

Synchronizing your email client then dealing with duplicate inboxes using thunderbird portable

I wanted to use Thunderbird portable on multiple machines but synchronize all machines. I use Microsoft's live snyc. this worked well until I started getting duplicate mail boxes! To resolve this I have to do two things
1)install Remove Duplicate Messages 0.1.07 not the alternative version.. this didn't seem to work for me.
2)go into Thunderbird and copy all messages from the duplicate folder into the main folder and then just to make sure you don't get mixed up, copy all combined messages into the duplicate folder the desired result would now be to have two folders with exactly the same messages in.
3)repeat this step for in boxes, sent and trash if so desired
4)right click each of the mailboxes and run "remove duplicates" continue this through all folders
5) the final step close Thunderbird and open the following \Data\profile\Mail\

your mail box name can be found by right clicking your inbox and selecting properties you should see something like mailbox:////Data/profile/Mail//Inbox in my case my mail box name was pop.iomartmail-2.com

6)Now delete all duplicates you should be left with the following
Drafts
Drafts.msf
Inbox
Inbox.msf
msgFilterRules.dat
popstate.dat
Sent
Sent.msf
Trash
Trash.msf

7)reload thunderbird and you should have just a single mail box!

Hope this helps and feel free to send a comment and I'll do my best to answer it.

Monday 15 February 2010

Installing a webserver on Windows XP the easy way

quite simply go to Microsoft Web Platform Installer http://www.microsoft.com/web/downloads/platform.aspx

this is more for my notes as I forget easily

Sunday 14 February 2010

Sending emails from a form on easyspace when using a windows server

I spent in the region of 5 hours on this one! admittley I was trying every method under the sun be it perl, php, javascript jquery.. anyways I found a very simple method that works

1)go to http://phpformgen.sourceforge.net and create a form, add a page then click on page one and start creating your fields, once you have done this and filled in all the other bits and bobs download the zip folder.

2)Open up the file processor.php and put the following line at the top of script, just under < ? php

ini_set ("sendmail_from","webmaster@MyWebSite.com");


3)Save the file :) and upload the contents to your website content folder and navigate to the www.yoursite.com/form.html file from a browser.

Hopefully you should be up and running.