happyneal

Elementary OS: Loki

Elementary OS: Loki

Elementary OS is a new Operating System that wants to be an alternative to Window or OSX. The team behind the project puts an high emphasis on Usability and Design.

Over the next couple of days I will try to actually switch to the system. Elementary is based on Ubuntu, which in turn is based on Debian, so all *.deb packages and programs can be installed without any problems. As with all Linux Distributions Elementary is free. However the developers require you to think about it if you would like to support their efforts or not. If not you enter a 0 into the download field.

For my initial setup I will essentially install all the common programs I use on a day to day basis. .

How To install Elementary.io

Step 1 Download the ISO

Go to www.elementary.io and download the current Version. If you have some money to spare you can donate to the project. If not enter a 0 and you can download the iso for free.

Step 2: Prepare a USB Stick

Go to https://rufus.akeo.ie/ and download the Rufus tool, this allows you to easily create a bootable USB stick.

Step 3: Install

Well for the last step you really just have to boot from the stick and follow the instructions.

First Steps

Remove Default Programs

The team focuses a lot on providing a suite of programs that also follow it’s design principles.

I would prefer to use Chrome as my Browser, and VideoLan for videos and I do not need an email client, or a dedicated calendar.  I removed them with these commands:

sudo apt remove pantheon-mail -y
sudo apt remove maya-calendar -y
sudo apt remove epiphany-browser -y
sudo apt remove audience -y

(The program “audience” is the default VideoPlayer)

Install General Programs

Chrome

Since Chrome has some Google stuff in it you first have to add it to apt with this command:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

VideoLan

To install VideoLan simply enter following command:

sudo apt-get install vlc -y

Skype

Microsoft has just recently announced that they will create a Skype Client for Linux. For now there is only the official “Skype for Linux Alpha”. Essentially the program is still barebones and is in very early stages of development. – If you install  it do not expect that everything will be working.


wget https://go.skype.com/skypeforlinux-64-alpha.deb
sudo dpkg -i skypeforlinux-64-alpha.deb

Shortcuts

⌘+Space App Launcher
Alt+Tab Window Switcher
⇧+Alt+Tab Switch Windows Backwards
⌘+Left/Right Switch Workspace
⌘+S Workspace Overview
Ctrl+⌘+Left/Right Snap Window to Half of Workspace
Ctrl+⌘+Up/Down Maximize/Unmaximize Window
⌘+T Terminal

Conclusion

The OS looks awesome, it feels like a system you actually could work with for a longer period of time. In the past I have always tried Linux for a couple of days and then said, well interesting, but a lot of my programs simply do not work and I would like to go back to Windows.

Let’s see how long this time the experiment is going to last and if Linux has become more user friendly over time.

Posted by happyneal in Blog, Linux, 0 comments
How to install Windows 10

How to install Windows 10

Preparation

You will need a USB-Drive with a minimum of 3GB free space.

Installation Files

Unlike previous versions of Windows, Microsoft has released a download tool.

  1. Download the tool from https://www.microsoft.com/en-us/software-download/windows10
  2. Attach the USB-Stick to your computer
  3. Start the tool and select your USB-Drive
  4. The tool will download the installation files and make the USB-Stick bootable.

Install Windows 10

Start your computer and boot from the USB-Drive

During Installation you should not use “Express Settings” but instead use “customize settings” and take a close look at the different options.

If you are upgrading a Windows 7 installation or Windows 10 has been previously installed on the computer Windows will not ask you for a Product-Key and does not need to be activated again.

Quick Program Setup

By using chocolatey you can quickly install most of the programs you need.

Install Chocolatey

  1. Open a cmd with Administrator Privilages (Windows Key > type “cmd” > Shift + Ctrl + Enter)
  2. Copy and Paste following script:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Install your programs

  1. Visit the chocolatey site to find packages (http://www.chocolatey.org)
  2. Open a cmd with Administrator Privilages
  3. Create your own script that looks something like this:
  4. choco install -y googlechrome vlc skype 7zip
    

 

Optimizations

Remove Preinstalled Apps

If you are running Windows on a Desktop without any touch capabilities, you will probably have no use for certain features, like Cortana or those Apps in the Start menu. Some of these Apps you can remove using the control panel, however Microsoft apps like “Mail” cannot be removed using the control panel.

To remove them you need to using an evevated Powershell (Windows Key > “Powershell” > Ctrl – Shift -Enter)

To remove a package

Step 1

First List all available Packages


Get-AppxPackage

Step 2

Use the name of the package, only one package should be selected


Get-AppxPackage Microsoft.Windows.Photos

Step 3


Get-AppxPackage Microsoft.Windows.Photos| Remove-AppxPackage

Note: It is not recommended to remove the Windows Store. It is rumored that you then cannot install anymore Windows updates after that.

 

Remove all Packages

As alternative run following command to remove all Apps (excluding the Windows Store).

 

Get-AppxPackage -AllUsers | where-object {$_.name –notlike “*store*”} | Remove-AppxPackage

Note: This command may also remove components you actually would like to keep It is better to create a controlled powershell script to remove only the apps you do not want.

Disable UAC (User Account Control)

Assuming you are a power user and you know what you are doing with Windows. You can disable the User Account Control using the elevated Powershell console.

With this oneliner you can disable UAC on your computer.


Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0

(Restart required)

Posted by happyneal in Windows, 0 comments
Getting Started using AngularJS with Yeoman and Visual Studio Code

Getting Started using AngularJS with Yeoman and Visual Studio Code

Typically to get started with a web-project you would start downloading libraries, configuring grunt etc. Yeoman is a project that takes care of all of this in a simple step and goes one step beyond, it also ensures that you will be using current web-standards. My editor of choice is Visual Studio Code (Other alternatives would be Atom, Sublime, Brackets etc.).

I will be using Windows as my Operating system, all Software is available cross-platform for Mac and Linux. Some commands need to be adjusted for the platform you are using.

Software needed:

Now it may seem odd that python and git is listed here. However while I was trying to get yeoman to work I discovered that bower requires git to be added to the path and since python was missing from my path, some odd errors occurred while creating the initial project.

Getting Started with Yeoman

Working with Yeoman requires you to work with the terminal.

Open Powershell (Powershell is the newer version of the console and emulates more a linuxlike shell) by searching for “Windows Powershell” in the StartMenu

  1. Install a lot of node stuff you need for yeoman
    npm install -g yo bower grunt-cli gulp
  2. Now you need to install the yeoman generator for angularjs
    npm install -g generator-angular

Your first Yeoman project

Simply because you are anyway in the console change the directory to your project directory (something like cd c:/projects)

You can create a new directory using the mkdir-command like:

mkdir angularProject

Finally run

yo angular

to create your project.

You have to answer a couple of questions which (modern) tools&frameworks you would like to use:

Sass (with Compass): Yes

Bootstrap: Yes

Bootstrap Sass Version: Yes

More information about the official yeoman generator-angular can be found here.

If everything goes smoothly the generator-angular created for you an entire modern webapplication project that uses angularjs.

The generated Gruntfile

Grunt is a taskrunner, when properly defined it can automate a lot of tedious work. Yeoman essentially does the work of properly defining the gruntfile.

A lot of tasks are to optimize your various files, like css, js and image files. It also takes care of running the preprocessors like sass or less.

It even runs your javascript tests with karma.js. (and now that grunt takes care of most of your repetitive tasks you maybe even have time to write some tests).

What do you need to know?

There are three commands you can use on the console:

  • “grunt” – simply runs all the tasks and provides a working webapp in the “dist” folder
  • “grunt serve” – starts a webserver and automatically updates your browser while you are working on the source files
  • “grunt test” – runs all of your tests

 Visual Studio Code Setup

Well there is not much to do. You need to open the folder of your project.

And out of the Box you can already run the build and test tasks.

To additionally run the “serve” task in Code

  1. Ctrl-Shift-P > Configure Task Runner
  2. In the tasks.json add a new task
     {"taskName": "serve", "isWatching": true } 

 To use the Visual Studio Code Debugger you need to adjust the Debug Configuration

  1. Ctrl-Shift-P > Debug: Configure
  2. Change the line “program” : “app.js” into “program”: “app/scripts/app.js”.

Conclusion

The power of this setup is mostly that most of the stuff comes out of the box, and provides you with a great foundation to create a high quality code project.

You can and should extend the gruntfile to suit your specific needs like to push your project onto your webserver.

Posted by happyneal in Web Technologies, 3 comments
Maximum Memory by Windows Services Configuration (BlackViper Settings)

Maximum Memory by Windows Services Configuration (BlackViper Settings)

There are a lot of tips and tricks on how to optimize your system memory. One of the main ways to get the most out of your system is to configure the “Windows Services”, essentially tasks and programs that windows starts and stops in the background. These services are needed by other programs, changing this configuration can result in that some programs cannot start or behave in a strange manner. If you mess around with the services, you could disable your access to the internet and its a pain to figure out which service you accidentally stopped that should have been running.

There are only two situations in which you should configure the services

  1. You are desperate and want to optimize a very old pc without having to buy new ram
  2. You are a gamer and want the speediest most lightweight computer

Service Configurations

Fortunately smart people have already played around with various configurations. BlackViper provides on his website a list of “tweaked”, “safe” and “default” settings. However the table on his website is interesting, but not very useful. If you would want to apply these settings you would have to open up “services.msc” and apply each setting manually.

Thankfully I found a way to convert the table into a powershell script.

  1. Head over to his site  http://www.blackviper.com/service-configurations/
  2. Go to your Version of Windows
  3. Use the websites Copy function and save the tap separated table into a textfile
  4. Execute following python code in the same folder

Alternatively you can download the resulting Powershell Scripts for Windows7SP1:  Win7SP1 – BlackViperPowerShell

Note: During the execution of the script errors appear for services that are not installed on your system – just ignore them.

Results

To consistently measure the memory usage I did a clean install of Win 7SP1 on a VirtualBox.

  • Default  39 Processes using  600MB Ram
  • “Safe Configuration”:  29 Processes using 500MB.

While the safe configuration ‘saves’ you 100MB of Memory. The amount of effort of testing if all your programs are still running correctly etc. Does not make a lot of sense – especially when typically you are anyway have 8GB+ RAM in Computers these days.

Image:

Posted by happyneal in Hardware, Python, Windows, 0 comments
EdX: Introduction to Linux

EdX: Introduction to Linux

I recently completed the course “Introduction to Linux” by the Linux Foundation on the edX platform. Instead of paying 2500USD for the course you now can pay 250USD for a verified certificate, or simply get an honor certificate.

https://www.edx.org/course/linuxfoundationx/linuxfoundationx-lfs101x-introduction-1621#.U-YKjfmSyyY

Course Structure

The course is self-paced, you can take the exam anytime and at the end of the month the certificate is going to be issued.

Course Materials

Unlike other edX courses most of the materials are short articles covering the core topics. There are short videos, however they are mostly useless.

Learning Objectives

Sadly the first couple of Lessons are more like Advertisements that Linux is great and that Linux is used everywhere and being able to use Linux is an important skill.

The rest of the course covers the basic operations when interacting with a Linux system.

The course briefly takes a look at the graphical interfaces of three major Linux distributions Ubuntu, CentOS and openSUSE.

As expected most of the course covers how to interact with the Console covers the basic interaction with the console, file operations, security principles, text manipulation and concluding with bash scripting.

Final Exam

The final exam is a 30 question multiple choice test. Sadly some questions are easier to be answered using Google than the actual course material.

People with an basic understanding of Linux could just skip the entire course and just take the exam. It’s rather straightforward.

Conclusion

The course is a great introduction to the Linux System. The course is designed for IT-Specialists (Programmers, Web-Developers, and Administrators etc.) that have not worked with Linux and need a quick introduction how to work with the system.

Sadly with the emphasis on using the console most users interested in using Linux as alternative to Windows/OSX will simply say “Oh god, what a hassle, I’ll stick to my current system.” Once again Linux does not realize that GUIs have been invented to solve an issue where most people find it confusing when they do not see what they are doing.

Most users interacting with a computer are not aware that it is possible to interact with a computer without GUI, telling those users that sometimes you simply do not have a GUI confuses them. Most of the success of Linux as core of Android is the GUI and that users have a simple way installing programs and are not able to access any console / text only mode.

Once again the core of Linux is great, however the presentation and usability is that what sells Linux.

 

 

Posted by happyneal in Blog, 0 comments
Forcing IE 10 to render pages as IE 10

Forcing IE 10 to render pages as IE 10

Web Design designed by Simple Icons from the thenounproject.com

Now isn’t that a silly title, sadly it’s one of those things I never thought I would have to deal with. Especially as Internet Explorers market-share is down to 8.8% in June. And seriously people switch to something that supports most of the web standard.

As a matter of fact Internet Explorer 10 defaults to render Webpages with its built in Compatibility Mode (IE 7) when displaying Intranet Websites.

Basically the thinking behind it is, we have an Advanced Browser (mostly) capable of rendering HTML5 Websites, but our Corporate Partners are so backwards that they are still running age-old Websites that possibly could be displayed incorrectly. In matter of fact they call this stupid Feature “Smart Defaults“.

Now as a HTML5 developer you would think, well yeah whatever I’ll just add a meta-tag to the <head></head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Well IE 10 looks at it and says “That can’t be right, I am in the intranet, and we don’t have cool HTML 5 sites here! I better render this in compatibility mode!!!”

So the only way to force Internet Explorer to do the right thing is to actually modify the settings of your webserver to add the exact same meta information to the HTTP Response object; Only then IE 10 will say, ok fine ill render it with my weird IE 10 render engine.

You can verify this using the Chrome Developer Tools

  1. Open Chrome, Press F12 to view the Development Tools
  2. Switch to the tab ‘Network’
  3. Navigate to the specific Page
  4. Verify that in the Get Request, the response Header “X-UA-Compatible: IE=10” or “IE=edge”Chrome-IE10-Header
Posted by happyneal in Web Technologies, 0 comments