Thursday, November 12, 2015

Trace Application in Linux

Using Strace,

Installaions "Fedora":
 dnf install strace
Running :
 strace -Tttvfs 1024 -o <output_file> <command>

Tuesday, November 10, 2015

Fortran, C and C++ for Windows

Download from :
and install it or extract it to C:\MinWG and if you use winsock.h or winsock2.h, compile it like below.

Compile the Code with : gcc code.c -lws2_32

this help from IRC channel.
<Love4Boobies> Move the -lws2_32 at the very end.

Thursday, November 5, 2015

Python MySql

 Simple use of MySql Python

mysql> CREATE TABLE pc_data (
    -> pc_title VARCHAR(100) NOT NULL,
    -> pc_command VARCHAR(100) NOT NULL,
    -> pc_ip VARCHAR(100) NOT NULL,
    -> pc_result VARCHAR(200) NOT NULL,
    -> PRIMARY KEY ( pc_id )
    -> );
cursor.execute("INSERT INTO pc_data ( pc_title, pc_command, pc_ip, pc_result)
                    VALUES ( "PC", "ipconfig", ipaddress, useragent );")

>>import _mysql
>>db.query("select * from comPc where com_id = 1")
>>r = db.use_result()

>>import MySQLdb
>>c.execute("select * from comPc")
(3L, 2L, 0L)

Flask Reqest environ

 request.environ['  set from below   ']
{'wsgi.multiprocess': False,
'SERVER_SOFTWARE': 'Werkzeug/0.8.3',
'PATH_INFO': '/',
'werkzeug.server.shutdown': <function shutdown_server at 0x7f303c4c6b18>,
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Fedora; Linux i686; rv:41.0) Gecko/20100101 Firefox/41.0',
'HTTP_CONNECTION': 'Keep-Alive',
'REMOTE_PORT': 17727,
'wsgi.url_scheme': 'http',
'SERVER_PORT': '8080',
'werkzeug.request': <Request '' [GET]>,
'wsgi.input': <socket._fileobject object at 0x7f303c4ab450>,
'HTTP_DNT': '1',
'HTTP_HOST': '',
'wsgi.multithread': False,
'HTTP_CACHE_CONTROL': 'max-age=0',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'wsgi.version': (1, 0),
'wsgi.run_once': False,
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7f30409df1e0>,
'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
'HTTP_X_REQUEST_START': 't=1446667986092501',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate'}

Java for Linux

Java Downloads for Linux

## java ##
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000

## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 200000

## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/ /usr/java/latest/jre/lib/i386/ 200000

## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/ /usr/java/latest/jre/lib/amd64/ 200000

## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 200000

Sunday, November 1, 2015

Linux and Unix screen command

Installing in Fedora

yum install screen
Start screen for the first time :
mib@itsecur1ty ~ $ screen

Show screen parameter :

Type “Ctrl-A” and “?” without quotes. Then you will see all commands or parameters on screen.
To get out of the help screen, you can press “space-bar” button or “Enter“.

Re-attach the screen :

mib@itsecur1ty ~ $ screen -r
Use screen -ls to see how many screen are available :
mib@itsecur1ty ~ $ screen -ls
if you want to restore screen :
mib@itsecur1ty ~ $ screen -r "number"
Note : Alternatives to GNU Screen for Linux Terminal :
Tmux and dvtm dtach.