Monday 22 June 2020

Learning to code

I started learning Python as part of my Cyber Security course (which is classroom based) we only spent one afternoon per week for one term (so far) and we we’re only learning the basics, but I have really enjoyed learning Python. So in my spare time I’ve been trying to increase my knowledge in Python to a point that I’m really comfortable and can write more complex programs. Once I’m totally happy with Python I’ll try to hop over to Java and C#.

I wanted to list some of the resources that I’ve been using improve my knowledge, because I’ve tried a load and some I like more than others (p.s. everything in my list is free).

I dip in out out of the following depending on how I feel…

  1. Harvard online CS50: Introduction to Computer Science URL: https://online-learning.harvard.edu/course/cs50-introduction-computer-science/

This mooc is really good at covering object oriented program fundamentals, the tutor covering the material is really energised and knows his stuff. The mooc includes both lectures and practice tasks for you to code.

  1. Jetbrains URL: https://www.jetbrains.com/academy/

If you sign up before 1st of July, you’ll get free access to Jetbrains until 2021 (no credit card required). I’ve been going through the Python tutorials and they’re really good. I’ve just been doing a couple of hours a week. They push their own IDE, PyCharm pretty hard (because it does some integration with their website). I didn’t really like it so have stuck with Visual Studio Code.

  1. Pygame/Youtube

I’ve known about Pygame for ages but whenever I’ve seen examples of games created in Pygame they’ve always looked really basic, I think this is because Python and Pygame is included in Raspbian (the Rasberry Pi distro) and Pygame is frequently used as a learning tool for kids. But it turns out that you can make attractive (2D) games in Pygame. Programming a game seems like a fun way to become learn to code complex functions and classes so this gets a thumbs up from me!

Tuesday 26 May 2020

Using Hugo

I played around with Django (a Python based web framework) all morning and managed to create an extremely simple blog site, but it was pretty complicated and time consuming for someone that wants something to “just work”. After some further Googling I stumbled onto Jekyll (https://jekyllrb.com/) and Hugo (https://gohugo.io/) these are extremely light/small static webpage generators.

 After some further Googling I discovered that you can host (static) websites for free on GitHub Pages AND they allow you to use a custom domain name, so I followed the tutorial here https://pages.github.com/ to create my own GitHub Pages site.

Then I just had to decide whether to go with Jekyll or Hugo, Jekyll has been around longer, is more established, and is based on Ruby. Hugo is newer but is becoming very popular, it’s based on GO, which is also a much newer programming language. There seemed to be a lot of people migrating from Jekyll to Hugo and another negative of using Jekyll is that you have to have Ruby installed locally whereas you don’t need GO installed for Hugo.

So I decided on Hugo, found a theme that seemed alright and here we are. So for the cost of a domain name, you can have a website hosted on Github for free. I’ve got GitHub desktop installed on my laptop so you literally just drag and drop the site that Hugo generates into your GitHub folder and hit the sync button which uploads it to you website.

Thursday 8 January 2009

Ubuntu on MS Virtual Machine (FIX)

To install

- At the prompt, press F4 and select “Safe graphics mode”.
- Then press F6 and delete the part that says “quiet splash –” and replace it with “vga=791 noreplace-paravirt”.

Once installed

1. Install Ubuntu 8.04
2. When Ubuntu is up and running you will need to make the “vga=791 noreplace-paravirt” fix permanent.
3. If you have installed Ubuntu and have not yet rebooted the OS, go to step 10. Else continue with step 4.

4. Press ESC quickly when you reboot. You should drop to a command mode interface.
5. Select “Ubuntu 8.04, kernel 2.6.24-16-generic” from the menu and press “e” to edit.
6. Select “kernel /boot/” etc, from the menu and press “e” to edit.
7. Add “vga=791 noreplace-paravirt” after “quiet splash” so the end of the line now reads “quiet splash vga=791 noreplace-paravirt xforcvesa”.
8. Press ENTER to finish the edit and then “b” to boot the system.
9. Ubuntu should come up with no problems. Log in with your username and password.

10. To make the fix permanent, open the Terminal window from the Applications/Accessories menu.
11. Type the command “sudo gedit /boot/grub/menu.lst” and press ENTER.
12. You will be prompted for your password. Enter it and press ENTER.
13. The Text Editor will then open. Add the same “vga=791 noreplace-paravirt” after “quiet splash” in about the 15th line from the bottom of the file.
14. Save the file and restart the system. Ubuntu should start with no problems.

Debian on MS Virtual Machine (FIX)

At weird screen press CTRL + ALT + F1. One of your ALT buttons is used to restore focus back to your real Windows environment, so you’ll need to figure out which ALT button to press. That key combination should get you back to the Debian command line.

At the command line login by entering “root” (Enter), then your administrative password (then Enter again).

Then type the following, followed by Enter:

sudo nano /etc/X11/xorg.conf

That brings up a “text editor”, which lets you edit the xorg.conf configuration file. Use the keyboard arrows to scroll down until you see the section titled “Screen”. Change the default depth from 24 to 16. Then press CTRL + O, Enter, CTRL + X.

Once you’ve done that, type the following (followed by Enter) to reboot the GUI:

sudo reboot

How to make your spam filter hardcore (IMF tweaking)

NB. The following document makes the assumption that you are using Exchange 2003 SP2 and that connection filtering/IMF on the SMTP virtual connector is enabled.

Step 1: Enable Intelligent Message Filter (IMF) auto update -The regular updates to the Intelligent Message Filter (IMF) will place the newest spam definitions onto mail processing Exchange Servers. (http://msexchangeteam.com/archive/2005/12/14/416070.aspx)



Step 2: SCL rating - We need to find out the average SCL rating of legitimate mail and the SCL rating of SPAM so we can tweak the IMF. To do this we can add a SCL rating header within an Outlook client. (http://support.microsoft.com/kb/895091)



Step 3: Store Junk E-mail Configuration - We should now have the average (ish) SCL rating of legitimate mail and spam. Go into the IMF settings tab on the Exchange server and amend the Store Junk E-mail Configuration to a number higher than the legitimate mail threshold but lower or equal to the spam threshold. If you set this number too low, you’ll get false positives and legitimate emails will be placed into the junk folder.



Step 4: Gateway Blocking Configuration – Set the number pretty high, seven is always good. If you are using additional software such as Symantec Mail for Exchange then set the When blocking messages action to No Action. We do this because we want our additional software to handle the messages from now on. If however you are not using any additional software then set this to one of the other options Archive, Delete or Reject depending on how you want the IMF to handle the spam.


Step 5: Connection Filtering Tab – Here we can enter the Real-time Blacklists (RBL). RBL’s deny SMTP connections to your server. They have no concept of email addresses and can only block connections based on whether the remote address is listed or not. Using RBL’s will block vast amounts of spam so I would recommend it. The following RBL’s seem to be pretty good:


bl.spamcop.net

zen.spamhaus.org

bl.csma.biz

t1.dnsbl.net.au


If you are using additional software such as Symantec Mail for Exchange then don’t bother configuring the Connection filtering at this stage, instead it can be done using your additional software. If you are not using any additional software then add the lists mentioned above.

Powered by Blogger.

My Blog List