Category: Uncategorized

Associate .exe files with Wine in Ubuntu Gnome 17.04

By , 2017-09-14 14:31

After installing Wine in Ubuntu Gnome 17.04, I noticed that double-clicking on .exe files in Nautilus still opened them in Archive Manager. I tried the usual right-click > Properties > Open With, but Wine was not listed as an available option.

It turns out that in the Wine package for Ubuntu 17.04, the wine.desktop file is not created in /usr/share/applications, and so does not show up in the Gnome GUI. To make things work, we need to copy the wine.desktop file from /usr/share/doc/wine-stable/examples/ to /usr/share/applications/

sudo cp /usr/share/doc/wine-stable/examples/wine.desktop /usr/share/applications/

Then edit the .desktop file to unhide it from the menus –

sudo nano /usr/share/applications/wine.desktop

Change NoDisplay=true to NoDisplay=false

Now, “Wine Windows Program Loader” is available as a choice in the Properties > Open With list.

MIDI

By , 2017-04-10 20:07

Windows Default Soundfont

Arachna Soundfont

How to get postfix to deliver root’s mail locally when using a smarthost

By , 2015-12-09 10:40

When setting up Postfix on Ubuntu/Debian as “Internet Site with smarthost” to use an external smtp relay, automatic e-mails intended for “root” (such as cron job error reports) get sent out to the smarthost with a To: address of [email protected]. This can cause a problem as the smarthost doesn’t know where to deliver these messages to, since myhost.mydomain.com has no MX record.

The fix for this is (go figure) in the Postfix README:

Delivering some but not all accounts locally

A drawback of sending mail as “[email protected]” (instead of “[email protected]”) is that mail for “root” and other system accounts is also sent to the central mailhost. In order to deliver such accounts locally, you can set up virtual aliases as follows:

1 /etc/postfix/main.cf:
2     virtual_alias_maps = hash:/etc/postfix/virtual
3 
4 /etc/postfix/virtual:
5     root     root@localhost
6     . . .

Translation:

Execute the command “postmap /etc/postfix/virtual” after editing the file.

Oddly, just adding the line

root: root@localhost

to /etc/aliases doesn’t work. You really need to do the steps outlined in the manual.

The magical feeling of being a sysadmin

By , 2015-04-07 21:18

It’s really cool what we can do with computers these days. I generally take technology for granted, but sometimes I am just in awe of what is possible.

 

4381851322_998492c432_o
With the ubiquity of the Internet
It’s all too easy to forget
How amazing it is, that with relative ease –
Just a few strokes of the keys
A sysadmin can ssh to a box running Unix
On the other side of the world, or just across town.
And with just a few clicks
Bounce that Windows box that’s gone down.

 

 

Image credit: https://www.flickr.com/photos/stars6/4381851322/

Written for OPS235 Course – Exam Preparedness

By , 2015-03-29 23:40

Students_taking_computerized_exam_crop

I feel ready for the OPS235 exam. There are a few areas I need to brush up on, but overall I feel I have a grasp  of most of the course content.

Strengths

  • CentOS installation
  • KVM administration via GUI
  • Package/software installation and updates
  • tar and file archiving/management
  • fstab and partition management

Weaknesses

  • Knowledge of specific commands and arguments/switches (rely on man pages)
    • iptables syntax
    • lvm commands
  • CentOS/RedHat-specific commands and conventions (used to Debian/Ubuntu)
  • SELinux
  • Memorization of .conf file structures

Exam review topics

  • KVM network configuration
  • User and group management

Written for OPS235 Course – Software and Installation Process

By , 2015-03-29 23:30

lamp-featuredSoftware installed

Apache

Apache is an open-source web server software maintained by the Apache Software Foundation and the open-source community. It can be extended using modules, and is well-documented and well-supported. It is usually the de-facto standard Web server on Linux, although lately new and customized Web servers such as nginx have been becoming more popular for dynamic, high-traffic sites.

PHP

PHP is a server-side scripting language mainly used for web development. By writing PHP rather than plain HTML, developers are able to create pages that are dynamically generated by the server on the fly depending on parameters provided. The Zend PHP interpreter is open-source software, and is available as a module for multiple Web servers on Linux, Windows, BSD and other OSes.

MySQL

MySQL is an open source relational database management system (RDBMS). It is open-source software, released under the GPL and sponsored by Oracle Corporation. The software is available at no cost, although there are also some paid versions. It has widespread use in Web applications, such as WordPress and MediaWiki, and is also used by large sites such as Facebook and YouTube.

LAMP stack

Together, CentOS (Linux), Apache, MySQL and PHP form an implementation of a LAMP stack. This stack provides a consistent, portable environment for Web developers.

WordPress

WordPress is an open-source blogging platform and CMS. It is written in PHP, and uses a MySQL database for text content storage and metadata. It provides an easy-to-use user interface, and is highly extensible and customizable with a large number of user-creatable themes and plugins. WordPress powers some prominent sites such as Forbes.com, vogue.com and nationalpost.com.

Problems encountered during installation

  • The systemctl command was not available, since this install of CentOS is using upstart rather than systemd.
  • There was no default index page created during the install of httpd. As a result, accessing HTTP on the Centos3 VM server gave an HTTP error 403 (Access denied) – the default Apache configuration denies directory listings.
  • The c6host machine was not able to access the HTTP service on centos3 because its iptables was not configured to allow inbound traffic on port 80.
  • When configuring iptables on centos3, running iptables -A INPUT -p tcp –dport 80 -j ACCEPT was notsufficient.
    • The -A option appends the rule to the end of the INPUT chain, however, there was a pre-existing explicit rule rejecting all packets.
       REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
    • To move the new rule above the reject rule, the incorrect rule had to be removed by running iptables -D INPUT -p tcp –dport 80 -j ACCEPT
    • Then, find the line numbers by running iptables -L –line-numbers
       Chain INPUT (policy ACCEPT)
       num  target     prot opt source               destination
       1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
       2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
       3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
       4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
       5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
    • Use iptables -I INPUT 5 -p tcp –dport 80 -j ACCEPT to insert the new rule above the existing rule 5.
    • Running iptables -L –line-numbers again gives the following output:
      Chain INPUT (policy ACCEPT)
      num  target     prot opt source               destination
      1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
      2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
      3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
      4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
      5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80
      6    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
  • The contents of the WordPress .tar.gz file were extracted to /root/wordpress. Moving this directory to /var/www/html resulted in the Apache process not being able to read the wordpress subdirectory. Copying (cp -R) avoids this issue.
  • When configuring the WordPress connection to MySQL, the WordPress documentation said to run the query
    mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
        -> IDENTIFIED BY "password";

    to allow access to the database. However, since the MySQL server and Apache/WordPress are installed on the same host, we need to use “localhost” rather than “centos3” for the hostname.

Trick PHP into thinking SSL/HTTPS is on

By , 2014-10-15 08:53

Not sure of the implications of this/best practices, but I just added

$_SERVER['HTTPS'] = 'on';

to my index.php.

Reason for this is that I am running a php app behind a reverse proxy, with the connection between the app server and the reverse proxy being plain HTTP, but the connection between the client and the reverse proxy is HTTPS.


				

Enabling DVD playback on Ubuntu 14.04

By , 2014-08-02 21:37

I don’t really play DVDs on my PCs much anymore, but my brother have me the full boxed set of Freaks and Geeks (great show, cancelled too soon). Running on a fresh install of Ubuntu 14.04, I popped in the DVD and was prompted by “Video Player” aka Totem to install some additional codecs. I obliged, but after the installation, the DVD still wouldn’t play. It turns out that because of legal issues, the libdvdcss2 library is no longer included in the Ubuntu repositories. However, the libdvdread4 package does provide a script to easily install it.

Once you have libdvdread4 installed, run following script:

# sudo /usr/share/doc/libdvdread4/install-css.sh

Restart your video player and enjoy your DVD.

Screenshot from 2014-08-03 01:35:17

Windows XP

By , 2014-03-22 15:03

Windows XP is going out of support next month.. This means Microsoft will no longer provide security updates or any patches for the OS, leaving users of the 12-year old version of Windows more vulnerable to emerging threats.

On this occasion, let’s take a moment to put dear old WinXP’s age in perspective. But first, some mood music:

When Windows XP was released…

Bill Gates was still CEO of Microsoft.

APW2001110119927

Gates with his new baby. Also Alias.

Friends, Buffy the Vampire Slayer, The X-Files, Frasier and Sex and the City were still airing new episodes.

btvs_s6e8

Vampires were still scary.

Friends Gets 11 Emmy Nominations

The one where Monica and Chandler are married and Rachel is freaking out.

We had yet to see shows like The Office, Arrested Development, House and How I Met Your Mother.

house-md_0001 2

There was no Gregory House in 2001.

The current-gen iMac had a CRT display.

imac_indigo

This was the competition.

There was only The Matrix.

matrix_revisited copy

This was true in 2001.

The “War on Terror” had only just begun.

The President of the USA.

The President of the USA.

The BlackBerry 950 was the current model.

rimblackberry950-1356315472-1

Portable productivity for the business professional.

How to buy technology

By , 2014-01-09 19:28

Being  a “computer” guy, I often get asked all kinds of questions related to technology.

Some questions that come up quite often are “What kind of laptop should I buy?” or “What do you think of [insert name of tablet]?” or “My laptop is old. I need a new one, but I’m thinking of Windows 8/iPad/Android instead. What are your thoughts?”

The best advice I can offer anyone is:

What are you looking for in your electronic device?

Whether you’re shopping for a car, a house, a phone etc. it helps to know what you’re looking for. If you work in construction and need to haul 2x4s and bricks and things fairly often, a sport coupĂ© is probably not the right car for you. Likewise, when picking a mobile computing device, you should think about what you need the device to be able to do. So, before shopping, take a step back and evaluate your needs and wants for your mobile computer.

So, before even looking at the latest Best Buy flyer – a few questions to ponder:

  • What are the workloads? Word processing, web browsing, YouTube (HD), e-mail, gaming, music, photo editing, etc.
  • What kind of apps do you want to use?
  • Where will you be using the device? In class? On the train/bus? In meetings? At your desk?
  • Will you be carrying the device a lot? In a bag?
  • Are you looking for something stylish? flashy? durable?
  • Do you really need a portable device? Desktop computers are still a good option, and there are interesting all-in-one options.

There are all kinds of technology form factors today, and more being created all the time. Everyone’s needs and preferences are different, but there’s probably a device that’s just right.

Custom theme by me. Based on Panorama by Themocracy