Showing posts with label How to. Show all posts
Showing posts with label How to. Show all posts

Tuesday, July 30, 2013

list open ports and unix sockets

To do this I use netstat command

to list all open ports:
$ sudo netstat -tuplen

to list open ports and unix sockets:
$ sudo netstat -nlp

note: using sudo you will get more info

Friday, July 19, 2013

Compile Python2.7 on CentOS 6

[ These steps may work on CentOS 5.*  too]

Prepare your OS for it

$ sudo yum groupinstall "Development tools"

$ sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel

Now Download python 2.7 at any location [say make a directory name py in your home directory]
$ wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
Unzip it:
$ tar xf Python-2.7.5.tar.bz2
Change directory:
$ cd Python-2.7.5
inside Python-2.7.5 directory run these command one by one:
$ ./configure --prefix=/usr/local
$ make

***
when make command finishes at the end you will see something like this:
----------
Python build finished, but the necessary bits to build these modules were not found:
bsddb185           dl           imageop
sunaudiodev                      
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
----------
NOTE: sunaudiodev is for Sun platforms,dl for 32bit platforms, imageop is deprecated and bsddb185 is undocumented.
***

$ sudo make altinstall

** you must use [make altinstall] otherwise you will corrupt the system
(CentOS comes with python 2.6 and yum is dependent on it if you use [make install] it will replace python 2.6 and yum may not work)

to test your installation run this command:
$ python2.7

Tuesday, April 12, 2011

php - keyboard input

I was thinking yesterday that is it possible in PHP to take input from keyboard. I started to digg and find out it is possible but no one use it because PHP was not designed to take input from keyboard :) anyway i am posting code here take a look :

#!/usr/bin/php
[php open tag]
function getinput(){
print("Your input: ");
$stdin = fopen("php://stdin", 'r');
$input = fgets($stdin, 1024);
$input = trim($input);
fclose($stdin);
return $input;
}

function output($message){
print $message."\n";
}

$message = getinput();
output($message);
[php end tag]

Thursday, September 2, 2010

how to fix osCommerce and php 5.3.* problem

The problem is php 5.3.* deprecated some functions.
so when you run osCommerce on php 5.3.* it gives warnings.

you can find deprecated functions here:
http://php.net/manual/en/migration53.deprecated.php

there is two ways to fix this.
1. replace all the deprecated functions with
equivalent alternative one (the hard way)
exmp:
replace eregi("[regex]", $str) with preg_match("/[regex]/i", $str)

2. disable deprecated warning from php.ini file.
set error reporting value to this: error_reporting = E_ALL & ~E_DEPRECATED

3. use php 5.2.*

Wednesday, July 7, 2010

Dolphin Complete Setup Guide

source: http://forums.dolphin-emu.com/thread-3533.html

Ripping your games is not discussed in this topic, this is ONLY the setup of dolphin itself. Warez is not supported on this forum, so don't ask where to get them, you'll be banned.

First... Things you need:

- A fast computer. (preferably Core 2 Duo or better, or high Athlon 64 X2(5200+ or better)
- The internet
- Roms to use with Dolphin (gamecube or wii)
- Time
- Two hands (it's possible to do with just one, but much easier with two)
- A Brain (This is very important.)

Now then, assuming you have all of the above, you'll be playing in no time, just follow these easy steps.

1.) Download Dolphin from your favorite builder. If you don't know where to get them, they are in the General Discussion sub-forum of the Dolphin-emu SVN Builds forum. Located here: http://forums.dolphin-emu.com/forum-6.html If you're unsure, just click the link in my signature, I update my builds quite often.

2.) Most people use 7zip to compress their releases, some use .zip or .rar, for those you can use Winzip or WinRAR, 7-Zip will work with them all, I suggest you download and install 7-zip from http://www.7-zip.org/

3.) Now, extract the downloaded compressed file to a new folder, make sure you know where this folder is.

4.) When you extract it, you will get several files and folders. Most releases have both the regular Dolphin as well as DolphinIL. the IL build is slightly faster than the original, however, it's also more unstable. You can use either one you want. So double click and open Dolphin or DolphinIL.

5.) You will get the main interface pop up. You could simply load the game from here, but chances are you will want to configure everything, like controls, graphics, sound, hacks and such.

6.) Click the options menu and click Configure. There are a lot of options. For the best settings for specific games, see the individual game posts in the Game Discussion forum.
For most games The best config is as follows:
- ON: Dual Core, Idle Skipping, HLE the BIOS all the time, Enable the JIT dynarec, Lock Threads to cores, Optimize Quantizers, LLE DSP on Thread, Confirm on Stop.
- OFF: Use Panic Handlers.
- You will also want to set your framelimiter to the desired framerate of the game you're playing, most of the time this will be 60, but for PAL games most is 50, some games are 30.

7.) In the second tab, This is all your own preference, you can set your language, controller types, and paths to memory cards. For most, the defaults will suffice.

8.) The next tab over is the Wii tab, Most Wii games prefer Progressive Scan on, but some do not, if you're having difficulties playing some wii games, you might want to disable this. You can also set sensor bar location, screen saver, aspect ratio and language. These are all you own preference options, the other option is called Enable EuRGB60 Mode (PAL6) Use this if playing PAL games, best to leave off if you don't play PAL games.

9.) The next tab is the Paths Tab. Here you'll want to add the paths to your roms, you might also want to set it to use subfolders depending on how you have your folders setup with your roms. Simply click Add, and browse to the location of your roms and click OK.

10.) The next and final tab is the Plugins tab, here you can select different plugins for Dolphin to use, Currently there are two video plugins for Dolphin, OpenGL or Direct3D. Direct3D currently runs faster than OpenGL, however has more graphical problems, if you're looking more for quality/compatibility use OpenGL, if the game seems to work with Direct3D without problems, you might be better off with it. Next is the DSP plugin, and you have 2 choices here, HLE and LLE. Unless you're just testing things on LLE, you're better off using HLE for the DSP plugin. (this is mostly for audio) The Pad plugin is for your controller or Keyboard setup, best to use nJoy 0.3, but you can play with the others and see which ones work best for your controller/keyboard. Last is the WiiMote plugin, there is only one as of this time.

11.) Click OK on this and click Options and select Graphics. Here you have options to setup resolution, aspect ratio, filtering, vsync, rendering to main window, post processing shaders, etc. Most of these are going to be your own preferences, If you are setting your own resolution and not using the native one, you should turn on Auto Scale. The rest of the settings are pretty much up to you to set. I'm not sure what games need Real XFB, but if a game isn't working you might try enabling that.

12.) In the other tab of the Graphics configuration, here's where the game discussion forum will come in handy, most people have documented the best settings for certain games.
- The top portion is informational, most of these you'll just leave off, I like to have FPS displayed so I turn that on.
- The Rendering portion is where you can disable certain features depending on the game, they require different settings. EFB Copy for the most part should be set to Copy EFB to system RAM. But again some games require this to be different.
- Below these is the Utilities, most of the time you'll just leave these disabled. Free look is kind of fun, but not useful to playing the game.
- Below that we have the hacks. Here's some of the hacks that help games to work better or work at all. Unless the game you're playing needs the hack, it's best to set this to none. Safe Texture cache is mainly for the Metroid Prime series, this should be off unless you're playing those games.

13.) Now click Close on that window, From here click OPtions and go to DSP Settings. Here you can set the volume and Audio and DSP settings, most games will use HLE Audio, DTK Music and Other Audio, enabled. RE0 fix is just a fix for Resident Evil game. should be disabled unless you are playing that game. Audio backend should be set to DSound, OpenAL works, but it's buggy.

14.) Click OK on that screen. Now all you have to do is set up your controller settings. (Options -> Pad Settings or Wiimote Settings for Wiimote) Those screens are pretty self explanatory just click the button you want to setup and press the button on your controller or keyboard you want to set it to.

And that's it, you're all setup to play, your games should be listed in the window and you can open them by just double clicking them.

Tuesday, July 6, 2010

Display Any Web Page's Keyboard Shortcuts

If you want to see keyboard shortcuts of your webpages
then do the flowing.

create userContent.css file in this location
if you have your own profile then make file there
or use default firefox profile.

win:
hit Start -> Run and type %appdata%\Mozilla\Firefox\Profiles

mac:
~/Library/Application Support/Firefox

then open that file using any text editor and pest this code:

a[accesskey]:after,
button[accesskey]:after,
input[accesskey]:after,
label[accesskey]:after,
legend[accesskey]:after,
textarea[accesskey]:after
{
margin-left: 0.3em;
content: "[" attr(accesskey) "]";
}

reload firefox enjoy :)

Monday, June 7, 2010

.pbp to .iso

Some people upload playstation games in .pbp format and
its not work with epsxe emulator.
but there is a work around :) here is the process.

you need two software:
1. psx2psp
2. ultraISO

feed .pbp file to psx2psp to make .img file
then feed .img file to ultraISO to make .iso file

now you can run your playstation game in epsxe.

Friday, May 28, 2010

MAC OS X pgup, pgdn, home and end

In MBP keyboard there is no pgup, pgdn, home and end key.
but there is an alternative to do that.

pgdn in shell -> fn+shift+down arrow
pgup in shell -> fn+shift+up arrow
home in shell -> fn+shift+left arrow
end in shell -> fn+shift+right arrow

pgdn gui -> command+down arrow
pgup gui -> command+up arrow
home gui -> command+left arrow
home gui ->command+right arrow

Tuesday, May 18, 2010

how to uninstall Xcode

to uninstall xcode from mac run this command in terminal:

$sudo /Developer/Library/uninstall-devtools --mode=all

Friday, May 7, 2010

installing solaiman lipi in ubuntu

$gksu nautilus /usr/share/fonts/truetype
paste the downloaded font in that folder.
$sudo fc-cache -f -v
press enter.
done :)

Wednesday, December 16, 2009

rapidshare download in linux

using wget:
---------------------------------------------------------------------------
wget \
--save-cookies ~/.cookies/rapidshare \
--post-data "login=USERNAME&password=PASSWORD" \
--no-check-certificate \
-O - \
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi \
> /dev/null
---------------------------------------------------------------------------
--save-cookies defines the location the cookie will be stored
--post-data provides the login form with your account's data
--no-check-certificate don't validate the server's certificate
-O downloads the html page to get the cookie and then it deletes it by redirecting it to /dev/null

Of course you must replace USERNAME and PASSWORD with your account details.

create a bash script file (save as rapiddownloader.sh):
--------------------------------------------------------------
#!/bin/bash
for url in `cat $1`
do
wget -c --load-cookies ~/.cookies/rapidshare $url
done

--------------------------------------------------------------
then:
chmod +x rapiddownloader.sh

command:
./downloader.sh urls

here urls is a text file containing urls of file in rapidshare

using aria2:
aria2c --http-user=USERNAME --http-passwd=PASSWORD -i urls -j 2 -s 4

Tuesday, September 29, 2009

How to Download ebooks from flazx.com

install forefox addon : Greasemonkey
insall Flazx Download Helper from this link:
http://userscripts.org/scripts/show/57408

now you can directly download ebooks :)

Saturday, August 8, 2009

How to change the Ubuntu Loading screen

Run both of these and you will be fine.

sudo update-alternatives --config usplash-artwork.so
sudo dpkg-reconfigure linux-image-$(uname -r)

Both have to be ran otherwise the change you make with step one will not take effect.

Wednesday, July 8, 2009

Wednesday, June 3, 2009

Remove MBR using dd command

Remove all:
dd if=/dev/zero of=/dev/HDD count=1 bs=512

Without partition table:
dd if=/dev/zero of=/dev/HDD bs=446 count=1

HDD is your hard drive letter

Thursday, February 12, 2009

Downloading from Restrictive Sites using wget

save these strings in a file named .wgetrc in home dir

header = Accept-Language: en-us,en;q=0.5
header = Accept: text/xml,application/xml,application/xhtml+xml,--
--text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
header = Accept-Encoding: gzip,deflate
header = Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
header = Keep-Alive: 300
user_agent = Mozilla/5.0 (Windows; U;--
--Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/3.0.6
referer = http://www.google.com
-------------------------------------
cmd: wget -dnv http://web/site/add

--(must be in a single line)

download one type of file from a site using wget

wget -r -l1 -A.file_ext --no-parent http://web/location/

Sunday, January 18, 2009

how to mirror using wget

wget --mirror –w 2 –p --html-extension --convert-links -P gwt_doc http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/index.html

Thursday, September 4, 2008

list open ports and unix sockets

To do this I use netstat command to list all open ports: $ sudo netstat -tuplen to list open ports and unix sockets: $ sudo netstat -...