Author Archives: S0n1C

Finding what version of Ubuntu you are running

Hello again,

So, like a good boy when Ubuntu released their latest version (11.04), I religiously upgraded my systems. I’ve gotten use to the new unity desktop environment, and I’d have to say that I do enjoy it. I’m still getting use to re-finding where everything is, and today I was looking to find what version of Ubuntu I was running. I already new I was running 11.04, but I was curious on how to find this information in the newest release. Before all you had to do was click on System->About, and you would be given your Ubuntu and Gnome versions currently installed. Obviously with the new layout, you can’t use this technique. I have found a new way of looking up this information, and it’s through the console. Which means that you don’t have to worry about your desktop environment anymore.

All you have to do is open a terminal and run :


cat /etc/lsb-release

I know this might be kinda n00b’ish, but we are all n00bs in one way or another.

I hope this helped.

P.S. If anyone has a topic / question they would like me to write about, please let me know and I will do my best to answer your request.

Regards,
Matt

Android AudioManager Demo

Hello All. I have been doing some research on the Android AudioManager API, and thought that since their aren’t many tutorials out there on this topic, that I would create one.

I am assuming that you already have a basic understanding of Java, and you have already installing the Android SDK on your computer. I am not going over how to create a project from scratch, but rather give you the source code, and explain it in detail.

I have built this so it will work on my phone, which is running Android 2.1.

If you have any questions, or need any extra help, please leave a comment below.

User Interface
==========

I’m aware that this interface is VERY basic, and is pretty lame. But I didn’t want to spend too much time creating the GUI, I just needed something that I could test the 3 main audio profiles, Normal, Vibrate, and Silent.

Since this UI is very basic, I haven’t included the XML file. All I did was add 3 buttons using a relative layout view. If you need help creating 3 buttons, let me know and I will help you out.

Code
====

Now to the fun part. In order to change any of the sound settings on an Android device you must first import the media AudioManager package.

import android.media.AudioManager;

Then you have to create an instance of the AudioManager

AudioManager audio;

Then all you have to do is set up the listen handler for the buttons and use the AudioManager function setRingerMode and set it to 0(silent), 1(vibrate), or 2(normal).

public void onClick(View view) {

if (view == findViewById(R.id.btnNormal)){
normalClick();
} else if (view == findViewById(R.id.btnVibrate)) {
vibrateClick();
} else if (view == findViewById(R.id.btnSilent)) {
silentClick();
} else if (view == findViewById(R.id.btnStatus)){
statusClick();
}
}

public void normalClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(2);
displayToastMsg("Normal");
}

public void vibrateClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(1);
displayToastMsg("Vibrate");
}

public void silentClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(0);
displayToastMsg("Silent");
}

So far, I have just given you the main segments of my code, I have also included a ‘view status’ button which simply displays a toast msg that tells the user what state their phone is currently in. Also, in every function I have called ‘displayToastMsg’ which is a simple function that displays what state the user has just switched their phone to.

Below is the entire source code from AudioBasic1.java

package matt.example.audioBasic1;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.media.AudioManager;
import android.widget.Toast;

public class AudioBasic1 extends Activity implements OnClickListener {
private AudioManager audio;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button normal = (Button) findViewById(R.id.btnNormal);
Button vibrate = (Button) findViewById(R.id.btnVibrate);
Button silent = (Button) findViewById(R.id.btnSilent);
Button status = (Button) findViewById(R.id.btnStatus);

normal.setOnClickListener(this);
vibrate.setOnClickListener(this);
silent.setOnClickListener(this);
status.setOnClickListener(this);

}

public void onClick(View view) {

if (view == findViewById(R.id.btnNormal)){
normalClick();
} else if (view == findViewById(R.id.btnVibrate)) {
vibrateClick();
} else if (view == findViewById(R.id.btnSilent)) {
silentClick();
} else if (view == findViewById(R.id.btnStatus)){
statusClick();
}
}

public void normalClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(2);
displayToastMsg("Normal");
}

public void vibrateClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(1);
displayToastMsg("Vibrate");
}

public void silentClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audio.setRingerMode(0);
displayToastMsg("Silent");
}

public void statusClick() {
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int status = audio.getRingerMode();
if(status == 0) {
displayToastMsg("Silent");
} else if (status == 1) {
displayToastMsg("Vibrate");
} else if (status == 2) {
displayToastMsg("Normal");
}
}

public void displayToastMsg(String status) {
String toastMsg = "Current Ringer Settings is " + status;
Toast.makeText(this, toastMsg, Toast.LENGTH_LONG).show();
}
}

If you are interested in downloading my Eclipse project, you can click [here] and download it from mediafire.

I hope this has helped someone out there. Please leave your comments, and let me know what apps you’re making.

References
=======

Android API – http://developer.android.com/reference/packages.html

ToastMsg – http://developer.android.com/reference/android/widget/Toast.html

http://developer.android.com/guide/topics/ui/notifiers/toasts.html

AudioManager – http://developer.android.com/reference/android/media/AudioManager.html

– Matt

Facebook Finally Smartens up

Last summer I was bored, so I went down to my local coffee shop that offers wi-fi. I’m sure I don’t have to tell you which one I went to, but just because I’m from Canada, doesn’t mean I don’t like spending 10 dollars on a coffee. Anyways, back on track.

So I was at the coffee shop, and decided to load up Wireshark, Ettercap and look at what people were doing on their computers. While Wireshark and Ettercap were working away in the background, I was busy creating a web page for my future MITM attach. Just as I was about to finish I looked over at Ettercap, and to my surprise I saw unencrypted Facebook passwords. I was thinking to myself, that can’t be. Facebook is one of the most popular sites to go to, and it requires the user to login, so it’s login credentials must be encrypted. Well they weren’t, and I received about 10 different usernames and passwords that I wasn’t even trying to get.

FYI to all my readers – Most Facebook goers use yahoo, Hotmail(live) or Gmail as their account login, and most people use the same passwords for both their e-mail accounts and their Facebook accounts, so PLEASE use a different password for each. As this will increase security, and protect your accounts even if one gets compromised.

Now, I didn’t write this to show you how awesome I was, and how I got Facebook accounts and passwords on a public network. I wrote it to show you how easy it is to do!

Well it was, until now. Facebook has finally released an option to use secure http. However, unless you know what you’re looking for, it’s pretty hard to find. Below is step-by-step instructions on how to enable Facebook with ‘https’. Now this setting takes effect on your Facebook account, and not on your computer. So no matter what computer you are using Facebook on, it will use secure http.

The images that I have included have been edited to hide my Facebook page, and my news feeds, I already have enough Facebook creepers, I don’t need any more.

INSTRUCTIONS
===========

1. Go to http://www.facebook.com, and login

2. Click on ‘Account’ -> ‘Account Settings’

3. Look for ‘Account Security’ and click on change

4. Check the option ‘Browse Facebook on a secure connection (https) whenever possible’

That’s it!

Now anytime that you are using a browser that supports secure http your Facebook login will be encrypted 🙂

I really think that Facebook should make more of an effort to make their users know of this new option, and what could happen if you don’t use it. If you are interested in reading the original post on the Facebook Blog

http://blog.facebook.com/blog.php?post=486790652130

Using Drivel To Update WordPress!

Figure 1

Okay, so I’ve finally got Drivel to word properly with my wordpress blog.

Install Drivel

You can download drivel from their homepage at

http://drivel.sourceforge.net/

or if your running ubuntu, it is already in the repository so you can simply install it

sudo apt-get update
sudo apt-get install drivel

Configure Drivel with WordPress

Open Drivel (Application->Internet->Drivel)

  1. Figure 2

    Enter Username

  2. Enter Password
  3. Select ‘Movable Type’ for the Journal Type
  4. Type in your blogs address ie

    something.wordpress.com

  5. Add xmlrpc.php at the end of your blog ie

    something.wordpress.com/xmlrpc.php

  6. Log In

After you have logged in, you will be given a screen like this (See Figure 3). Now here is the hard part, finding something worth blogging about, and pressing the ‘Post’ button.

Figure 3

You also have the option to save your draft locally, this comes in handy if you don’t have access to the Internet, and feel like blogging about something. It allows you to write your blog, save it, and then post it the next time you connect to the Internet.

I’m Back

Okay, so i’ve had to take a short break from blogging. You see I got my first job about a month ago in my field (for those of you that don’t know, it’s Computer Programming). Anyways, so ya I got my first job, and have had no time to blog. I have a few topics that I want to write about, and a ton of drafts that I need to get around to finishing up.

A couple month ago, I did a post on Linux Blog Editors. When I posted, I decided to use Gnome Blog. As great as Gnome Blog is, the main reason why I was using it was because it had an applet that sat on the desktop. A feature that I very much enjoy. However, I am running gnome-shell a lot, and now don’t get that running applet, so I have decided to try out a couple of the other blogging clients that I mentioned.

Right now, I am writing this post in Drivel, however I am having some problems with it, and hopefully it will update my blog. I will edit this post with all of the steps required to update your wordpress blog from Drivel.

I’ve also done some of my drafts within Word This. And I have to say, I really enjoy the layout, the only drawback to it is, you have to run it in a web browser. Most of you might not see this as a flaw, but as soon as I open my browser, I want to serf the net, not blog. I’m sure that I’ll get over this impulse, and use it a little more.

Here are some posts that I’m working on right now, a little something that you can look forward too!

  1. A quick post on a script call wepbuster (more details to come, I don’t want to give anything away)
  2. A brief description of what I do at work, and what languages I use(Can’t go into much detail, but still interesting, well at least to me)
  3. OpenJarvis (Something I’ve been meaning to start for a while, and finally have some POC to show you!)

Embrace the Change

So Ubuntu 10.10 have been out for a few months now, and as Canonical states it’s a perfect 10! You can check out my old post for most of the major changes made in Ubuntu Maverick Meerkat(here). I was looking forward to the new Ubuntu Netbook release because of it’s improved interface. I did try it out, and was very impressed with it, however I have found something I like better!

Although it’s still in development, and is not included in Ubuntu 10.10. GNOME 3 and it’s Gnome-shell has an incredible interface. When GNOME 3 is finished, Ubuntu will eventually use it as the default desktop manager, and most of you will probably end up using GNOME Shell after you get use to the new interface.

Since I embrace change, specially when it comes to open-source projects. I have already downloaded and installed Gnome-shell. I do not have it set to my default desktop, but I do use it on a regular basis. I do have to admit, at first I was against the new interface but I fought through my resistance to learn the new interface and now enjoy using the new sleek, user friendly interface.

If you would like to install Gnome-shell on your computer, I got all of my information from the gnome website(here). But here is the break down of what you have to do to install gnome-shell on your Ubuntu 10.10 system.

  1. Download the deb file from lauchpad (here) and install it. -> This option is okay if you are just wanting to test it out, but I suggest adding gnome-shell to the repository, that way it is always up to date.
    To do this, add
    deb http://ppa.launchpad.net/ricotz/staging/ubuntu maverick main
    to your source list, then open a terminal and run the following commands
    sudo apt-get update
    sudo apt-get install gnome-shell
  2. After it has been installed open a terminal, or press <ALT> F2 and type:
    gnome-shell --replace

That’s all there is to it, gnome shell is now running on your desktop. Now if you want to stop it, just press  <ALT>C in the terminal window, or logout and back in again. We have not made any changes to your desktop configurations, but if you want to use gnome-shell as your default desktop, that process is also quiet easy to accomplish.

  1. Open a terminal
  2. run gconf-editor
  3. Navigate to Desktop->gnome->session->RequiredComponents
  4. Replace whatever is in windowmanager with gnome-shell

(Screen shot below shows the gconf-editor window with the proper option selected)

Now I’m not going to go into much detail on how to use gnome-shell, or the pros and cons of it, either your going to like it, or your not. I’m not going to try and convince you either way. I just wanted to give you the change to check out what the new Gnome is going to look like. I’m sure that once Ubuntu has integrated to Gnome 3, they will probably keep with the default desktop, with both the panels on the top and bottom, but have gnome-shell as an option in the background for anyone that what’s to use it instead.

Linux Blog Editors

So I’ve been looking around for a nice Blog Editor. As you know I’m a Linux user, and use Ubuntu 10.10 ( Which was released today, and will probably upgrade to the final release as soon as I’m finished posting)

What I was looking for was an app that I could run on my desktop, and that had the basic bloging utilities(tags, categories, bold, links, pictures, etc).

Since I’m using Ubuntu, and the Gnome desktop, I wanted something that could integrate into the desktop, and was somewhat clean looking. I do enjoy wordpress’ interface, it allows to to customise your theme, modify your settings, and it even allows you to blog! But when I want to write a quick post, I think the wordpress layout is a bit much.

What I found was a program call Gnome Blog(link). This program is light weight, and can be added straight to a Gnome panel.

Gnome Blog

During my quest to find an editor best for me, I came across a few that you might be interested in.

Drivel Blog Editor – http://drivel.sourceforge.net/

BloGTK – http://blogtk.jayreding.com/

Word This (Google Chrome Extension) – https://chrome.google.com/extensions/detail/nkchahlbhcbjfgidpikjfkdbjffbmhpl

ScribeFire (Firefox Addon) – https://addons.mozilla.org/en-US/firefox/addon/199790/

Now, Gnome blog is very simple and basic. It does hold back on certain options that you might want, like adding a category and tags. But in the end, this is exactly what I was looking for. Something that looks nice, looks good on my desktop, and allows me to post a quick blurb on my blog.

If you use a different blog editor, or have comments on Gnome blog please leave me a comment. Tell me what you like/dis-like about Gnome Blog, and if you use a different editor, why your editor is better.

Thanks

Talk to you soon

Ubuntu 10.10 Maverick Meerkat

With the latest installment of Ubuntu exactly a month away, I’ve decided to talk about some of the new changes in Ubuntu 10.10 Maverick Meerkat, how one would upgrade to Ubuntu 10.10 Beta if you so choose, and a technique that can be used to downgrade back to 10.04.

New Features
==========

As always Canonical has done a great job of including new features, as well as a new default theme and wallpaper. The new wallpaper that is included with the Beta is very unique. I will let you all come up with your own opinions.

I don’t particularly like it, and will probably stick to the wallpaper that I have been using for the last couple years(If you are interested, I have included it on the bottom).

Some of the main things that have been updated in Ubuntu 10.10 are:

  • Gnome 2.31 – Ubuntu 10.10 does not include Gnome 3.0 however I’m sure that Ubuntu will include it when they are ready
  • Evolution 2.30 – Suppose to run faster than other version on Ubuntu 10.04
  • F-Spot has been replaced with Shotwell as the default photo manager
  • Gwibber has been updated to improve performance
  • Sound Indicator – I am very happy about the update they need on the sound indicator – They have included a music playback options with in the applet. Now all you have to do is click the speaker in order to start/stop and change your music.
  • Ubuntu Software Centre has been updated to include many new features, one major one is the history option. You now have an option to view your installation history. This might come in handy when testing new programs.
  • Meerkat also comes with the newest Linux kernel

For all you Netbook users out there, you will be happy to know that Ubuntu has updated a new interface for there Netbook Edition of Ubuntu. I purchased my first netbook a few mouths ago, and was excited to test out Ubuntu Netbook Remix. Ubuntu has been my distribution of choice for a very long time, mainly because everything they do is great and always impresses me. This was not the case for the Netbook Remix, I did not enjoy the look of the desktop at all and quickly switch back to the default Gnome desktop. Ubuntu has created a new Unity interface which I can’t wait to test out.

Ubuntu Netbook Remix 10.04

Ubuntu Netbook Edition 10.10

Install Ubuntu 10.10 Beta
==================

Now for the reason why most of you are here, to upgrade to 10.10 Beta.

  1. Open up ‘Run Application’ by holding Alt+F2
  2. Type ‘update-manager -d’ and press ‘Run’
  3. You will now see the Update Manager. Click on the Upgrade button beside ‘New ubuntu release ‘10.10’ is available’
  4. Follow all the onscreen instructions to finish

If you do not see the ‘Upgrade’ button you might have to tell your computer to allow ‘Normal’ upgrades and not just LTS(Long Term Support).

edit ‘/etc/update-manager/release-upgrades’

change Prompt to Prompt=normal.

Downgrade to Ubuntu 10.04
====================

If you have decided to upgrade to the beta, and for one reason or another you want to go back to the way things use to be, stable, reliable, etc. I have found this post giving some suggestions on how you might go about doing a downgrade. I’m not sure if this works, nor am I responsible for any damage this does to your system.

http://ubuntu.stackexchange.com/questions/3659/downgrade-from-one-version-to-a-previous-version/3675

Hello world!

Welcome to by new blog! Here you will find a range of information about computers, computer security, tips and tricks, etc. Other things you might find posting about are on Hockey, NHL news, and anything else that I feel like posting about. If your interested in updated NHL news, and jersey concepts check out my buddy’s blog over at Hockey Jersey Concepts.

If you don’t know a lot about me, most of my information is in the about but the summary is I’m a heavy Linux user, that enjoy everything computers and hockey.

Stay tuned for a little blurb about Ubuntu 10.10, and how to upgrade to Beta if you so choose.