Sep
6
2011
Ben Hoskins
Right, after a lot of unsuccessful googling I came across a solution to the new Linux Ubuntu’s new UI Unity not working in WMware Fusion.
The reason Unity does not work is something to do with the ‘accelerated hardware/graphics’ not being compatible at this moment. And, finally there is a solution to this.
Unity is a 3D UI hence the extra acceleration needed. So.. we can install a 2D version, which from what i understand is completely the same (just without all the whistles and bangs).
First we need to add the 2D repository to our Ubuntu’s software manager. In terminal type:
sudo add-apt-repository ppa:unity-2d-team/unity-2d-daily
Then we need to update Ubuntu’s app cache:
sudo apt-get update
And finally install the new 2D version of Unity:
sudo apt-get install unity-2d-default-settings
Then restart and choose Unity 2D from the Session options at the bottom right when you next login.
Before
During
After
2 comments | tags: 11.04, 2d, 3d, ubuntu, unity, wmware | posted in Linux Ubuntu
Sep
6
2011
Ben Hoskins
Just a quick note for boredom and Linux Terminal (I SSH to mine of course):
if($you == BORED) echo 'screw with linux terminal';
I would suggest you try out:
- Lynx – a terminal website browser
- cmatrix – terminal matrix thingy
- greed – a kinda terminal puzzle game
- moon-buggy – a terminal platform game
- nethack – a full-on hard core (really need to be a massive n3rd to play it, I only lasted 10mins before I gave up) cave exploration game
To install any of them just use the classic:
sudo apt-get install APP_NAME
*replace APP-NAME with the program you want.
no comments | tags: Boredom, games, linux, programs, terminal | posted in Life, Linux Ubuntu
Aug
9
2011
Ben Hoskins
Here some simple tips to help with manipulating text, the simplest of things can be the most valuable.
First, if you only want to pull one character from a string, it’s a lot easier to use the following:
$string = 'puppy';
echo $string[0]; // p
echo $string[1]; // u
echo $string[2]; // p ...and so on
And here’s the basic concept behind the substr() function:
substr($string, start # [, length #])
– length is in brackets because it’s optional
Now let’s use this function to get a better idea of what it does.
$string = 'categories';
echo substr($string, 0); // 'categories' because we asked to start at the first character (which is 0 from the first example above) and goes right until end of string
echo substr($string, 3); // 'egories' because started at the third character in the string and went to the end
echo substr($string, -1); // 's' this is different from above because it starts at the end and goes left that number of characters
echo substr($string, -3); // 'ies'
echo substr($string,0,-1); // 'categorie' strips last letter off
echo substr($string,3,4); // 'egor' - starts at the fourth character (remember 0 is the first) and shows 4 characters total (length)
echo substr($string,1,3); // 'ate' - starts at the second character and shows 3 characters total (length)
echo substr($string,1,-2); // 'ategori' because we started at the second character and also stripped off the last two with the "-2"
echo substr($string,-3,-2); // 'i' since we're starting from the third character from the left and then are stripping off two characters from that with the "-2"
I sometimes use this if I only want to display a preview description rather than showing the whole large description.
$text = 'Great for home, school or travel. Wonderful gift item!';
echo substr($text,0,25).'...'; // displays "Great for home, school or..."
no comments | tags: php, substr | posted in PHP, Software, Tips & Tricks, Website Design
Jun
10
2011
Ben Hoskins
iftop is a real good utility both for your own computer and for your server. Specially good for the latter and even better if this server is acting as the main router in your premises or your experiencing unusual network usage.
Well lets explain what iftop does, it is more or less like top, or htop but it does not measure the processes in the processor, it measures the “processes” in the ethernet interface, giving you information about the IPs that have a connection with the computer where iftop is running, also giving information about the traffic, if it is incoming or outcoming, also how much traffic there is in that connection and the total amount of traffic in the interface.
To install on a Debain/Ubuntu like Linux OS use the following terminal command:
sudo apt-get install iftop
You may find some of the options useful;
-p Enables promiscuous mode, so the traffic on any interface (if there is more than once) is checked and counted.
-P Shows also the port that connection is using both on our side and on the other side.
-N Do not resolve port names, which is the default behavior when you enable the -P option, so it will shows you :www or :80
If you want to know any more about iftop simply use the command (outside of iftop):
man iftop
and this will bring up the iftop manual.
Have fun analysing!
no comments | tags: Analyse, Iftop, linux, Network, server, Traffic | posted in Linux Ubuntu, Software
May
26
2011
Ben Hoskins
So it turns out there is no built in function to add a key and value to the start of an array. There is;
array_unshift() - Prepend one or more elements to the beginning of an array.
However, this will only add a value. So the method we use is to create a new array with the key and value you wish to add to another and use;
array_combine — Creates an array by using one array for keys and another for its values.
For example:
$existingArray = array("fred" => "orange", "john" => "IsaSpy");
$array['our_key'] = "our_value";
$newArray = array_combine($existingArray, $array);
print_r($newArray);
//boom
no comments | tags: add key and value to array, addition, arrays, php | posted in PHP, Software, Tips & Tricks
May
21
2011
Ben Hoskins
Minecraft is simply amazing.
Now im not a gamer and never intend to be, however, Minecraft is just awesome and is soo much fun ^^
Simply put, your a guy, in a world, where you can do anything you wish. The only game objective it to live your life.
You can build buildings, mine for better materials to build with or use them in your every day life, fight monsters at night (Creepers are simply epic), farm, invent, explore, adventure, you name it you can do it in Minecraft!
One of the better things about Minecraft is its ability to use different themes for your worlds called ‘texture packs’ and after much usage and research here are my favourite ones (in no particular order)…
Quandary

NatureCraft

ShreeyamaCraft

Cube Craft

SexyCraft

Bamt4st1c

no comments | tags: best, minecraft, texture packs | posted in Inspiration, Life, Software
Apr
29
2011
Ben Hoskins
Wow, really now. I didn’t think it was possible for an organization/website to be so perfect. Twitters new and updated website is truly a triumph. Beauty and Simplicity @HozzaMedia

no comments | tags: design, twitter | posted in Inspiration, Life, Software, Website Design
Jan
27
2011
Ben Hoskins
!|= ¥0U c4|\|7 R34|) 7H!$ !7$ 83c4U$3 ¥0U |)0|\|7 |<|\|0w 4|\|¥ 1337
Continue reading
1 comment | tags: l33t | posted in Software
Jan
13
2011
Ben Hoskins
Now, VNC is the method we can use to remotely control our Ubuntu computer (now also an SSH server) [see SSH Basics & Server Setup]. In the administration section of the Ubuntu computer you will find a GUI to help set up your VNC over your local network (ticking boxes and assigning a password).
Once you have that set up, you can then VNC to your server (now a SSH/VNC Server & Ubuntu Desktop) with a program such as Tight VNC on windows or Mac’s built in VNC client, simply point your program (VNC Client) to your Servers internal IP address (assuming your on the same network, 192.168.1.??) and choose the port number (a hole in your computers firewall to let data though) for example I would point my VNC client to 192.168.1.67:5900 as port 5900 is the default VNC port.
Continue reading
no comments | tags: local port forwarding, localhost, secure, ssh, tunnel, vnc | posted in Apple Mac, Linux Ubuntu, Software