Solution: PHP setcookie Warning: Cannot modify header information - headers already sent to avoid this problem add ob_start() at beginning of php and add ob_end_flush() at end of php code like below
<?php
ob_start(); // Initiate the output buffer
//your code
ob_end_flush(); // Flush...
Linux users we provide solutions to different Problems we face every Day. This is Linux Troubleshoot Site, developed by Linux users.
Saturday, 30 March 2013
Wednesday, 27 March 2013
How to Flush route table in Linux
To remove or Flush all entries in route table the command used is
root@system1:~# ip route flush table main
Run Above command as ro...
Friday, 22 March 2013
PHP Replace new lines, tabs and multiple spaces with single space
preg_replace('/\\s+/', ' ',$data) used to Replace new lines, tabs and multiple spaces with single space in PHP
example:
<?php
$data = 'Hi tab i am
new line more spaces';
$data= preg_replace('/\\s+/', ' ',$data);
echo $data;
?>
Output:
Hi...
Monday, 18 March 2013
Upgrade Cent OS from any version to Any version
To Upgrade CentOS the common command used is yum update. This is used to Upgrade Cent OS from any version to Any version.
command:
As a Root
root@system1# yum upda...
Find the size of folders in linux
Finding the size of a directory and finding the amount of free disk space that exists on your machine. The command you would use to find the directory size is ' du '. And to find the free disk space you could use ' df '.
$ du
Gives you a list of directories that exist in the current directory along with their sizes. The last...
XOR of Hexadecimals in C program Example
To do XOR in in C the operator used is "^"
#include<stdio.h>
int main()
{
int x;
int y;
int res;
printf("\n Please enter the value for first number in hex format:");
scanf("%x",&x); //reading hexadecimal value
printf("\n Please enter the value for second number in hex format:");
scanf("%x",&y);
res=x^y;
printf("\n...
Solution: Access Variables in Different C files
To access variables in different C files, check below example
header.h
extern int a;
file1.c
#include</root/path/header.h>
int a;
a = 20;
file2.c
#include</root/path/header.h>
printf("a value is %d",a);
Note: if you compile individual file and check then you may get error
Compile like:
gcc file1.c file2.c...
Solution: warning: ISO C90 forbids mixed declarations and code
If you get above warning means in your code operation code in between deceleration see below example
Invalid Code:
main(){
int a;
a = function1();
int b;
b = function2();
}
Valid Code:
main(){
int a;
int b;
a = function1();
b = function2();
}
So write all declarations one pla...
Tuesday, 12 March 2013
Set Up SCTP in Linux From SCTP Module
Fedora has SCTP kernel as the kernel module, kernel recompile is not needed for our case. Instead, the SCTP kernel module is simply needed to be loaded into the RAM memory on the Fedora with the command ‘modprobe’. The command ‘modprobe SCTP’ plays...
Sunday, 10 March 2013
Jquery Mobile header footer moving problem while click
This post will show how to avoid header, footer moving up and down while clicking
to avoid this problem add data-tap-toggle="false" at header and footer
example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>App</title>
<meta content="width=device-width, minimum-scale=1,...
Thursday, 7 March 2013
Upgrade Backtrack 5 R2 to R3
To upgrade Backtrack 5 R2 to R3 follow below steps
System@bt# sudo apt-get update && apt-get dist-upgrade
For 32 bit Systems
System@bt# apt-get install libcrafter blueranger dbd inundator intersect mercury cutycapt trixd00r artemisa rifiuti2 netgear-telnetenable jboss-autopwn deblaze sakis3g voiphoney apache-users...
Solution : Backtrack 5 apt-get upgrade error var/lib/dpkg/info/w3af.postins
If you ger below error ,simply download missing file to /tmp folder
system@bt:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
smartphone-pentest-framework
0 upgraded, 0 newly installed, 0...
Solution : dpkg: warning: parsing file 'magic tree':error in Version string 'r1643-bt0': version number does not start with digit
If you get error like below Simple remove packages which are causing error
dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5812 package 'magictree':
error...
Solution : Error while processing magictree_r1802-bt0_all.deb Sub-process /usr/bin/dpkg returned an error code (1)
If you get Error Like Below
Errors were encountered while processing:
/var/cache/apt/archives/magictree_r1802-bt0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Simply delete the file which causing Error
system1# rm -rf /var/cache/apt/archives/magictree_r1802-bt0_all.de...
Add HTTP Proxy to SVN - Subversion
Below Instructions show how to setup proxy for SVN -Subversion
system1# cd ~/.subversion
system1# ls
auth config README.txt servers
Edit servers file
system1# gedit servers
Add Below Lines to servers file
[global]
http-proxy-host = your_ipaddress
http-proxy-port = 3128
http-proxy-compression...
Subscribe to:
Posts (Atom)
Here We Write The Problems we face at different situations and Solutions to those problems.