Brothersoft Mobile: GrooveShark 2.1.3

Days ago, Mick Genie ever share on the Brothersoft Website and I’m now decide to get weekly review of their download site. ūüôā

Today, I am going to share some mobile Apps from Brothersoft Site.


As previous review on Grooveshark from Mick Genie site at here, it is a site to share the music which is legal from the Internet and you may now install Grooveshark with your mobile.


Grooveshark 2.1.3(posted 22 November 2010) is a mobile apps that supported for Android Operating System and it fixed for several bug.

If you interested this software, please download it from here.
http://www.brothersoft.com/mobile/grooveshark-77979.html

iptables filter mac address

Mick Genie ever guide how to allow and block IP, port, etc from iptables, however there is another option which is to block or allow mac address.

MAC address stand for Media Access Control Address and it could be specifically for a network.

To block a mac address, simply run from shell.

iptables -A INPUT -m mac –mac-source 00:11:22:FF:33:EE -j DROP

WScript: Get Email when disk space low

Yesterday, Mick Genie come out a script to generate the free space from your computer, and it might useful for you for certain purpose.

However, I have think off if this is very inconvenience if you need to login to the computer for every time.

Hence I have come out another script to use IIS SMTP server to send an email to you when the disk space is low.

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = “Disk Space Alert: ServerName”
objMessage.From = “Disk Space Alert<Disk Space Alert>”
objMessage.To = “[email protected]

Dim objShell, space_value, Result
Set objShell = Wscript.CreateObject(“WScript.Shell”)

Set DiskSet = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery (“select * from Win32_LogicalDisk where DriveType=3″)
For each Disk in DiskSet
If (Disk.Name=”D:”) Then
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Result = Disk.FreeSpace
End If
Next
space_value = Result
Wscript.echo space_value
if space_value < 30 then

objMessage.TextBody = “Server Disk Space Low, ” & space_value & ” GB”
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “127.0.0.0”
objMessage.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25
objMessage.Configuration.Fields.Update
‘objMessage.Send

end if

You need to change the Subject, From, To, Email IP, and port only.

Note: This script tested only work with 32bits box, but not 64 bits box.  Save this file to anyname.vbs will do.

Windows Script object to get free space

Today, Mick Genie has come out same sample script to calculate the  free space from particular disk drive.

Below is the sample script as you may use the following script and save it to file.vbs.

Set DiskSpace = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery (“select * from Win32_LogicalDisk where DriveType=3″)
Dim Result
For each Disk in DiskSpace
If (Disk.Name=”D:”) Then
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Disk.FreeSpace=Disk.FreeSpace/1024
Result = Disk.Name + ” ” + Disk.FreeSpace + ” GB”
End If
Next

WScript.Echo Result

With above script, you may change the drive with D: to E: , F: , etc and you will get the information from the drive specifically.

MySQL: Load Data Infile or Outfile

For many cases, you might want to load your data out from the database to a text file or dump the database through the SQL query with a .sql file without a control panel such as phpmyadmin, etc. You may actually done it through the MySQL console query engine.

In this article, Mick Genie will guide you on Load Data Infile and Outfile from MySQL databases query.

Basically, you will need to understand what is infile and what is outfile, to differentiate it, you might refer to the detail as below.
infile: when you using infile, that meant you are inserting data to the database and it is the same when you are using < symbol from the MySQL console.
outfile: If you understand infile, then you shall understand outfile is use to grep the data from the database and store to the text.

Below is the sample script with infile could be used from the PHP script.

$tableName¬† = ‘mickgenie’;
$query = “LOAD DATA INFILE ‘mickgenie.sql’ INTO TABLE $tableName”;
$result = mysql_query($query);

Below will be the outfile sample from the MySQL query.

SELECT * INTO OUTFILE ‘data.txt’ FIELDS TERMINATED BY ‘,’ FROM table2;

Connect ASP.Net script with MySQL

It is very easy if you have ASP.Net script and want to connect to MySQL databases.

Today, Mick Genie will share how to connect your MySQL database with your ASP.Net script.

Sample Code:
==========
<%@ Page Language=”VB” debug=”true” %>
<%@ Import Namespace = “System.Data” %>
<%@ Import Namespace = “MySql.Data.MySqlClient” %>
<script language=”VB” runat=”server”>

Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection  As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim myDataSet     As DataSet

Dim strSQL        As String
Dim iRecordCount  As Integer

myConnection = New MySqlConnection(“server=localhost; user id=mickgenie; password=password; database=database;”)

strSQL = “SELECT * FROM mytable;”

myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New Dataset()
myDataAdapter.Fill(myDataSet, “mytable”)

MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()

End Sub

</script>

<html>
<head>
<title>Simple MySQL Database Query</title>
</head>
<body>

<form runat=”server”>

<asp:DataGrid id=”MySQLDataGrid” runat=”server” />

</form>

</body>
</html>
==========

From the above code, you may change the setting from myConnection and you shall be able to connect without any problem.

iptables

Mick Genie ever posted iptables Handy Guide earlier. However there do not have clear guide on which function and it’s description.

Most of the Linux Operating System do come with iptables and it is used to control the packet traffic of a PC.

Iptables used to manage through chains and there are three type of chains
– INPUT : Control Incoming packet
– OUTPUT : Control Outgoing packet
– FORWARD : Control packet that are forward

In order to control the chain, you need some action,
– ACCEPT : To allow a packet
– DROP : To disallow the packet
– REJECT : The target packet will be stopped.
– RETURN : Go to another chain of table.

iptables

Useful Linux Monitoring Tools

If you still remember Mick Genie ever post on how to monitor RAM/Memory on Linux earlier from http://www.mickgenie.com/monitor-rammemory-on-linux/, you should have an idea on the basic command to monitor Linux server.

Today I would like to share some useful monitoring tools from Linux box. With Linux monitoring tools, it uses to analysis and debugging the Linux box.

1. Top Process
– Top process is the most used by the Linux user as it come with many useful information such as it’s server load, memory, iostat, etc.

With top command, it do comes with some hotkey.
t – Displays summary information off and on.
m –¬†¬† ¬†Displays memory information off and on.
A –¬†¬† ¬†Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system.
f –¬†¬† ¬†Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.
o –¬†¬† ¬†Enables you to interactively select the ordering within top.
r –¬†¬† ¬†Issues renice command.
k –¬†¬† ¬†Issues kill command.
z –¬†¬† ¬†Turn on or off color/mono Continue reading Useful Linux Monitoring Tools