Category: Tech Blog

Operating Systems: Chrome OS, Ubuntu Linux, Mac and Windows

Over the years, since my dad first was messing with DOS in 1995, when I was 6, I have used a lot of operating systems, having had both stressful and wonderful times with them all. 

Since 2007, when I started uni doing IT and venturing outside the Microsoft world, I have always become annoyed with my current operating system, and wanted to switch – then repeat this cycle. 

Here is an overview of my experiences and conclusions about the various operating systems.

Windows

Being the default installed on most computers, and being the most widely available, this is what I started with, and what I fall back on when things go wrong.

I wish I didn’t have to use it, but from my experience, pretty much all programs I need work on it, and it has Adobe Creative Suite – which I use a lot, Photoshop, Illustrator, InDesign, Premier Pro, After Effects… 

Ubuntu Linux

If I could use any operating system, it would be Linux, for ethical and philosophical reasons, however I have had many frustrating experiences with it, perhaps because I’m not so well versed in it all. 

Going on from above – if Adobe Creative Suite was available, or there were replacement programs as good/ easy to use – I would probably only use Linux.

Apple Mac

I used a MacBook for a while, and it was shiny good. There were bugs and hoops to jump through, but I thought it was ok.

Chrome OS

I haven’t used it, but for a netbook type computer, I would really love it. Since 2007 uni times, more and more I’ve been moving house into the cloud. It all started when our uni Microsoft Word was having some terrible issues, maybe it was on an application server or something, but it was slow as hell, and a friend noticed/ mentioned that Google Docs was much faster, so I stated using it – backed up all my documents to the unlimited G-Cloud – and have never looked back since. Then with YouTube’s unlimited Blue Ray quality video uploads and Google Plus’s unimited 2048 pixel photo uploads, things got more and more off my hard drive and into the cloud. 

Google Play can’t find media

If you ever have some songs unable to play on the Google Play app, try the following:

  • Go into settings -> apps -> all -> MediaStorage -> clear data (This doesn’t delete any of your files, just the cache database with a list of where all the media files are on your phone
  • Then reset your phone, so it will rebuild some of the cache again

I downloaded some songs to my phone, then uploaded them to Google Play. I then deleted the local files, and tried to play them with Google Play without success. The system was still trying to play the local versions which didn’t exist. When the cache was deleted, all worked fine instantly!

Simple PHP email form with basic spam protection CAPTCHA

There are two pieces of code – the one which will display your email form, and a block of code to add into your “mailer” page – a page dedicated to sending the messages and displaying confirmations and errors.

Feel free to edit or tweak the code, download the images to your own server and use however you wish.

The form

<!-- email box ~ -->
<div style="width:400px;text-align:right;padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
<form action="send.php" method="post" style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
<p style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
Name: <input type="text" name="email_name" size=20><br>
Email: <input type="text" name="email_email" size=20>
<?php
$one = 1;
$two = 0;
$three = 0;
$four = 0;
while ($one % 2) $one = rand (10000,99999);
while (!($two % 2)) $two = rand (10000,99999);
while (!($three % 2)) $three = rand (10000,99999);
while (!($four % 2)) $four = rand (10000,99999);
?>
<br>Are you a human or internet virus?
<br>Choose the odd one out:
</p>
<div style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
<input type="radio" name="email_valid" value="<?php echo $four ?>" Checked=1> <img src="https://pushka.com/p/i/sys/lion.png" alt="This is a public domain image">
<input type="radio" name="email_valid" value="<?php echo $two ?>"> <img src="https://pushka.com/p/i/sys/elephant.png" alt="This is a public domain image">
<input type="radio" name="email_valid" value="<?php echo $one ?>"> <img src="https://pushka.com/p/i/sys/lifter.png" alt="This is a public domain image">
<input type="radio" name="email_valid" value="<?php echo $three ?>"> <img src="https://pushka.com/p/i/sys/penguin.png" alt="This is a public domain image">
</div>
<p style="width:200; text-align:left;padding-bottom:0px; margin:0px 0px 0px 0px;padding-top:0px; padding-left:150px;">Message:</p>
<textarea rows="7" cols="30" name="email_msg" style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">
</textarea><br>
<input type="submit" value="Send">
</form>
</div>

The sender and confirmation message generator (should be in the main text region of your regular website theme)

<div title="main"><h1>Send</h1>
<div style="width:400px;"><br /><br />
<?php
$name = $_POST["email_name"];
$email = $_POST["email_email"];
$valid = $_POST["email_valid"];
$message = $_POST["email_msg"];
$error = 0;
if (strlen($email) == 0) {
echo "<img src='https://pushka.com/p/i/sys/cross.png'> Please enter an email<br>";
$error =1;}
elseif (strpos($email,"@") === false | strlen($email) < 6){
echo "<img src='https://pushka.com/p/i/sys/cross.png'> Please enter a valid email in the form X@X.XX<br>";
$error=1;}
if (strlen($message)==0){
echo "<img src='https://pushka.com/p/i/sys/cross.png'> Please enter a message<br>";
$error=1;}
if ($valid%2){
echo "<img src='https://pushka.com/p/i/sys/cross.png'> There was an error with the image validation, please select the odd one out.<br>";
$error=1;}
if (strlen($name) == 0) $name = $email;
$message = "This message was sent from pushka.com/p - from " . $name . " \n ---------------------------- \n \n " . $message . " \n \n ---------------------------- \n \n \n";
if ($error==0){
echo "<img src='https://pushka.com/p/i/sys/tick.png'> Email Sent<br><br><FORM><INPUT TYPE='button' VALUE='Back' onClick='history.go(-1);return true;'> </FORM> <br>";
$to = 'you@mail.com';
$subject = 'Message from pushka.com/p';
$headers = 'From: ' . $email . " \r\n" .
'Reply-To: ' . $email . " \r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
else{
echo "<br><FORM><INPUT TYPE='button' VALUE='Back' onClick='history.go(-1);return true;'> </FORM> <br>";
}
?>
<br><br>
</div>
</div>

 Here is an example

The emails are sent to the Cosmic Owl, who may or may not ever respond to you

[widgets_on_pages id=”PHPemailForm”]

You can have both blocks of code on the same page if you have action=””

Pushka 4 Google, Valve, etc.

What I’d really love is to build my own business or be an artist, rather than working as a tool in a giant corporation to be bashed until my soul is destroyed and my will yielded to their monolith income generating strategies…

However there is one company I would love to work for (well I have discovered more) After watching the Life at Google videos, I found that Google is an amazing company with a mission I love, and a work culture that is different from what you’d think a typical business would be

Valve

This seems even more chaotic and creative than Google, with no boss, Valve runs on a completely flat management system and employees are free to create and innovate in all their ventures (also their desks have wheels, so there’s no getting stuck in a rut ~ always moving ~ )

 

Google IO 2011 – signing in from Australia

I’m currently watching the bginning of Google IO Develoers conference from Australia ~

so exciting ~ it’s the 1st I’ve listened to ~

I’ll give live updates ~ (though on the Google IO 2011 website, there are also live streming, updates and announcements)

  • Update to Honeycomb, Ice-cream Sandwich (I mised this)
  • Android market + Movie rentals (like on YouTube)
  • Google Music Beta – online iTunes replacement in the cloud with auto sync
  • Open accessories – anyone can make any type of accessories that work with Android
  • Android at Home – Android can work with any item in your house, if inbuilt, or if you connect to a receiver

I can’t believe how smooth and amazing the Google IO live stream is ~ there must be thousands watching and it doesn’t skip a beat~

There were 2 main streams on the live streaming  ~ Android and Chrome – both of which I’m really interested in – wish I could watch it all ~ I think it will all be released soon~

And huge news for browsers and the killing of IE6

  • There is a plugin called Google Chrome Frame, which can be installed on machines without admin privaliges, that renders web pages through Chrome in IE if the webpage has opted in (with a meta tag) – so websites can use HTML 5, modern flash, 3d graphics etc. in IE6 with this plugin.

Also Google Open Fonts is exciting:

  • Rich fonts like what is used in print, Google hosts them, so there isn’t any down time, there is no licencing issues, because it’s open, and Google handles cross-browser quirks and browser updates etc., option for compression, optimisation, only download characters you need, caching.

Featured Video rather than Image for WordPress

Some templates have a featured image, but sometimes you want a video instead… But not all the time..

You can set some custom fields, and then add in PHP – if the field has something in it – display the embedded video (at the same size the featured image would have been…)

The text in the custom field should just be the ID code for YouTube or Vimeo (or you can add your own if you want… but you need to add the embed code to the PHP)

The code gets the ID and inserts it into the embed code.

<?php
if (post_custom(‘a YouTube ID Code’)) {
echo ‘<iframe width=”640″ height=”402″ src=”https://www.youtube.com/embed/’ . get_post_meta($post->ID, ‘a YouTube ID Code’, $single = true) . ‘” frameborder=”0″ allowfullscreen></iframe>’ ;
}
else if (post_custom(‘a Vimeo ID Code’)){
echo ‘<iframe src=”http://player.vimeo.com/video/’ . get_post_meta($post->ID, ‘a Vimeo ID Code’, $single = true) . ‘?title=0&amp;byline=0&amp;portrait=0″ width=”400″ height=”225″ frameborder=”0″ webkitAllowFullScreen allowFullScreen></iframe>’ ;
}else{
?>

 

add the YouTube or Vimeo ID code to a custom field:

  • a YouTube ID Code
  • a Vimeo ID Code

EG:

  • bH9tJXm2Bcw
  • 31934775

From the original YouTube links:

  • https://www.youtube.com/watch?=bH9tJXm2Bcw&feature=channel_video_title
  • http://vimeo.com/31934775

Shift Joomla and WordPress installs

  • Copy HTML/CSS/etc. – folders. everything
  • Move the database

Login to old cPanel -> PHPmyAdmin
select databse, check all tables, “export” – all (custom – all options)

Go into new PHPmyAdmin
import all

edit (WP-config.php,. config.php (in Joomla)

Edit the database location:

  • Databse name (same)
    But – might be something like:
    old DBS name is “shop”
    new name is “rotapixt_shop”
  • Server (local host if it is on the same server, else the address (EG: http://cpanel.something.com)
    it’s possible to install the HTML files on one FTP account server, and install the database on a different server….
  • Database user username:  (hosting account username/ password login)
  • Database user password

Note:
In website hosting – you have an account username and password, this is the same for :

  • FTP account
  • cPanel login (maybe PHPmyadmin has a different password)
  • Database / MySQL username / password (would be the same as PHPmyAdmin)

Joomla – Configuration.php:

  • host $host
  • DB name $db
  • username MYSQL $user
  • pass $password

WordPress – wp-config.php

  • commented with labels ~

LOCAL HOST =

HTML goes in the htdocs folder

http://localhost/cpanel(then click “PHPMYADMIN” to edit database

  • DBS name = whatever you call it in PHPmyadmin
  • server = localhost
  • username = root
  • password = “” (nothing)

My default WordPress Settings

I always set this stuff up like this:
  • General
    • Site title/tagline
  • Writing
    • Default Post category – change name from default to (something with relevant keywords in it)
      Edit this in Posts->Categories
  • Reading
    • Front page displays “static page”
      • Create 2 new blank pages called  “home” and “blog” – set these two ~
  • Discussion
    • Disable the 2 emailers when people comment
  • Permalinks
    • Custom
      • /%category%/%postname%/