Update Ubuntu 16.04 Login Message

The standard login message is called the MOTD and usually looks like this:

Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-116-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

29 packages can be updated.
11 updates are security updates.


Last login: Wed Jul 11 18:35:08 2018 from 555.555.555.555
[email protected]:~$

This text is generated by a series of executable files in /etc/update-motd.d that you can change or even add your to.

[email protected]:~$ ls -la /etc/update-motd.d
total 36
drwxr-xr-x  2 root root 4096 Jun  6 15:43 .
drwxr-xr-x 92 root root 4096 Jun 28 08:34 ..
-rwxr-xr-x  1 root root 1220 Oct 22  2015 00-header
-rwxr-xr-x  1 root root 1157 Jun 14  2016 10-help-text
-rwxr-xr-x  1 root root   97 May 24  2016 90-updates-available
-rwxr-xr-x  1 root root  299 Jul 22  2016 91-release-upgrade
-rwxr-xr-x  1 root root  111 Jan 11 05:42 97-overlayroot
-rwxr-xr-x  1 root root  142 May 24  2016 98-fsck-at-reboot
-rwxr-xr-x  1 root root  144 May 24  2016 98-reboot-required

I decided to modify mine to display the system’s IP addresses on login and disable 00-header, 10-help-text from running:

[email protected]:~$ ls -la /etc/update-motd.d
total 44
drwxr-xr-x  2 root root 4096 Jul 11 19:54 ./
drwxr-xr-x 91 root root 4096 Jul 11 16:59 ../
-r--r--r--  1 root root 1220 Oct 22  2015 00-header
-r--r--r--  1 root root 1157 Jun 14  2016 10-help-text
-rwxr-xr-x  1 root root  147 Jul 11 19:54 50-ip*
-rwxr-xr-x  1 root root   97 May 24  2016 90-updates-available*
-rwxr-xr-x  1 root root  299 Jul 22  2016 91-release-upgrade*
-rwxr-xr-x  1 root root  111 Jan 11 05:42 97-overlayroot*
-rwxr-xr-x  1 root root  142 May 24  2016 98-fsck-at-reboot*
-rwxr-xr-x  1 root root  144 May 24  2016 98-reboot-required*

As you can see, to disable a file you only need to remove the execute permissions. When you add a file it’s important to think about the order in which they’ll execute. These scripts are run alphabetically which is NOT the same as ‘numerical order’

 

Here’s the IP script I added.

#!/bin/bash
echo -e "\n\nSystem IP Addresses: "
ifconfig | grep "inet addr" | cut -d: -f2 | awk '/([0-9]{1,3}\.){3}[0-9]{1,3}/ { print "\t" $1; }'

Of course you’re could do anything in these scripts such as list the current load, free space, memory usage, logged on users, etc…

Illegal Phone Call Scams

These days the average user is far wiser against email spam than ever before and criminals are turning back towards direct threats in telephony-based shakedowns of vulnerable people. Thankfully the advent of websites like Who Called Me and Twitter mean you can easily discover if the number that called you is a known scam or not.

Once you know it’s a scam you can report it to the police directly through 101 if it’s not an emergency or 999 if you believe it’s something more serious than a simple scammer. Remember, you can also report crime anonymously through CrimeStoppers so make sure you say something if you get one of these calls!

Is it a scam?

  1. Do you recognise the number?
  2. Is the caller from a company you have a relationship with?
  3. Are they asking for your details?

It may sound obvious that a call from a company you don’t know from a number you don’t recognise asking for your bank information is suspicious but what would you do if you got a call from a stern police officer demanding to you know where you were on Tuesday? Or a pleasant individual calling to advise you’ve over paid on your water bill and are due a refund?

Whatever the purpose someone claims you need to be mindful of what information you’re giving out. Did the caller address you by your full name like a real company representative would or did they wait until you gave up that information first? Did they confirm your address to you or get you to let go of that as well?

If you’re ever in any way doubtful of the authenticity of a caller’s identity HANG UP and use the Internet to identify the number it came from. You could even simply call the company back on a known safe contact number from their website or your contract with them.

Elite Dangerous Useful Tips

Elite Dangerous is a massively multiplayer online role play game with a huge amount of space and wide-open gameplay with a few key areas for players to interact with. These are some links I have found to be particularly useful in the game.

The Road to Riches – Easy money from exploration of Earth Like Worlds, Water Worlds, and so on. By taking your ship out to these worlds and scanning them you will earn anything from 2 million to 6 million an hour.

Make sure not to explode, though, as you’ll only get your reward once getting back to a station and selling your data on the Stella Cartography section of Station Services.

https://www.edsm.net/ has several useful tools but I like this mainly because it shows an out of game log of what you’ve done, your credits, your ships, and a bunch of stats which can be shared with friends. You’ll need to use a tool to read your player logs and send them to the site, I use Elite Dangerous: Market Connector.

http://elitedangerous.hozbase.co.uk/ is useful for finding specific things like black holes to go sight-seeing.

Building your ship is the most expensive, and fun, thing you can do in the game made much easier with the excellent Coriolis tool. You can use this to see how much money you need to buy certain ships, use its links to find stations to buy the modules from, see how effective it’ll be at combat, and even plan out module engineering.

Travian – Worth Playing?

No! Not unless you can get in at the start of a game round. In the village-building and conquest game you control a ‘hero’ character who can go on adventures and build up local resource gathering so you can progress to better structures, defences, unites, and even grow your own guild.

You begin with newbie protection from other “players” (usually just scripted bots) so you cannot be attacked until you’re ready. However, you can never catch up to withstand any attacks by long-standing players and there’s nothing you can do to prevent the botting from whittling away your resources.

The game has many microtransactions and is extremely pay-to-win so if you like throwing money at something this game may be interesting for you. However, if you like to have fun and enjoy building things in games this is definitely something to avoid.

Converting ASP Classic to PHP5

I posted a while ago that I added a page with ASP Classic to show your current IP. This worked because the site was being hosted in IIS with ASP.NET, ASP Classic, and PHP all enabled but I have now moved to a PHP only host and wanted to quickly get the IP lookup working again (I use it quite often).

I can potter around with PHP and would be able to figure it out but I did a quick search to find a converter and discovered this great online tool which did the work for me!

Here’s the original code.

<%@Language="VBScript"%>
<%
If Request.QueryString("debug") = "1" Then
  Response.Write("<pre>")
  For Each x in Request.ServerVariables
    Response.Write(X & " = " & Request.ServerVariables(X) & vbCrLf)
  Next
  Response.Write("</pre>")
Else
  If Len(Request.ServerVariables("HTTP_X_FORWARDED_FOR")) = 0 Then
    Response.Write Request.ServerVariables("REMOTE_ADDR")
  Else
    Response.Write Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  End If
End If
%>

 

Here’s the converted result.

<? 
if ($_GET["debug"] == "1") {
  echo "<pre>";
  foreach ($_SERVER as $x) {
    echo $X." = ".$_SERVER[$X]."\r\n";
  }
  echo "</pre>";
}
else {
  if (strlen($_SERVER["HTTP_X_FORWARDED_FOR"]) == 0) {
    echo $_SERVER["REMOTE_ADDR"];
  }
  else {
    echo $_SERVER["HTTP_X_FORWARDED_FOR"];
  }
}
?>

 

It works exactly the same as before but this time it’s PHP. You can try it with the same link: What is my IP?

Review of Udemy Online Learning

At the start of 2018 Udemy ran a promotion where courses could be purchased for up to 95% off their original price so, naturally, I had to take advantage of this and picked up an The Complete Android N Developer Course by Rob Percival.

There are hundreds of courses available and I picked this one because I’ve been interested in making mobile applications for a long time but always found the YouTube videos clunky and disjointed to watch. Based on the high quality content provided by Rob in his Android course I picked up a few others on other topics and found that the overall quality of instructors on Udemy appears to be very high. They, or at least the ones I’ve found, take the time to enunciate clearly and speak at an appropriate pace even if English is not their native language which makes their topic much easier to follow and a pleasure to watch.

I will likely make a future post documenting a basic timer app being developed from start to finish or if I feel confident enough maybe even a simple game good enough for the Play store!

Teclast Master T10

I purchased this new tablet through GearBest which is an online retailer specialising in products from China. As you might expect, some things get lost in translation but on the whole this seems to have been a good purchase.

The price changes day by day and I managed to pick it up for £152 with about a 3 week wait. In fact I’m writing this review on the tablet right now.

 

 

 

The device itself is a good size, the screen is bright, it’s mostly responsive to touch, and is lightweight. There were some minor problems though:

  • There was no launcher installed. This meant there was no button to list all apps despite Launch3 apparently being installed. I managed to install it from the play store which seems to be fine.
  • Netflix says it isn’t compatible with this device and so cannot be installed from the Play store.
  • Ingress won’t load because it can’t find the location.
  • Apps will minimise if you double tap the fingerprint scanner which is in an awkward place to avoid.
  • It does not come already rooted.
  • There is one Chinese only app and it cannot be uninstalled. It is some sort of app hiding app from what I can read using Google Translate live translation from my phone’s camera.

Summary

It seems to be a decent device so far and is much easier to read articles and code on than my phone.

Christmas Shopping vs the High Street Business

I’ve almost finished buying gifts for everyone and I suddenly realised I hadn’t entered an actual shop. This year Amazon have almost completely fulfilled the festive shopping which can clearly put a big dent in high street sales. So why is this?

Ads on sites

Many websites have pop-up ads to entice you with special offers and instant discounts but these cover the content and instantly put me off. To make things worse, it seems that once a site has decided to have intrusive ads they go all out and include automatically playing video, newsletter signups, or even the dreaded auto-play audio.

These techniques not only send visitors scrambling for the back button but put them off from ever coming back. Not forgetting the mobile user who may be paying extra data charges simply for the privilege of having unwanted advertisements displayed.

Online shopping

Convenience is the most obvious reason that Christmas, or any, shopping is done online. It is now possible to ask someone what they would like for their birthday or the holidays and quickly order it so you don’t forget, all while pretending to have a casual conversation so they you can keep the gift a surprise.

The likes of Amazon use employ the use of shopping lists but, more than that, they track which products you have viewed and provide related suggestions. This is almost like an automatic, seemingly endless, shopping list of items that most likely will interest you.

Weather, Items, Location

Who really wants to be wandering around in the cold trying to carry gifts for the whole family? It’s just not possible to do in a single trip. What happens if you get out to your car and drop something breakable? How much time do you really want to spend travelling to a crowded place to choose from a limited selection and then fight your way back home through traffic? Physical shops lose out to the comfort of online shopping but always win in one important way: You can pick up and look at the potential gift.

Being able to touch, play with, sometimes open, or try on different items can help ensure you get the perfect present for that special someone so there are no disappointments on the day. In most shops you can usually find an assistant who will be willing to help and try to answer any questions you have about the product. The staff may not be able to beat the wider Internet on technical questions but that’s why you have a smartphone.

Conclusion?

Physical shops are unlikely to ever disappear but I think many would benefit from greater integration with the likes of Amazon, PayPal, or other services that can let them establish an online presence. The bigger names in the street have already done so but spare a thought for the small shops and maybe, if you can, take a visit and see what specialities they’re hiding in their offline world.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑