Wednesday, December 22, 2010

how to linux mac spoofing ...

Ubuntu

In Ubuntu, you can explicitly set a MAC address for your network card. You can either do it manually (Working with MAC Addresses) or use a package called macchanger (GNU MAC Changer).
To manually change your MAC address, for example, for eth0, you do the following:
sudo vim /etc/network/interfaces
And then you add following line to end of interface being configured (eth0 in this example):
hwaddress xx:xx:xx:xx:xx:xx
where xx:xx:xx:xx:xx:xx is the MAC address.
So now your interfaces file may look like this:
auto eth0 static
iface eth0 inet static
address 10.10.1.5
netmask 255.255.255.0
gateway 10.10.1.1
broadcast 10.10.1.255
hwaddress ether 02:01:02:03:04:08

Do the following to make sure all changes are applied:
sudo ifdown eth0 (warning: you will lose connectivity on this interface when you run this command, so make sure you are able to access your computer either via console or through another interface to run the rest of the commands)
sudo ifup eth0
sudo /etc/init.d/network restart

CentOS

Open the file of the network interface you want to modify and add the following:
HWADDR=xx:xx:xx:xx:xx:xx
MACADDR=xx:xx:xx:xx:xx:xx
For example, if you want to explicitly specify a MAC address for eth0, you do the following:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
And then you add following line to end of file:
HWADDR=xx:xx:xx:xx:xx:xx
MACADDR=xx:xx:xx:xx:xx:xx
where xx:xx:xx:xx:xx:xx is the MAC address.
So now your ifcfg-eth0 file may look like:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
IPADDR=10.10.1.5
NETMASK=255.255.255.0
GATEWAY=10.10.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
HWADDR=02:01:02:03:04:08
MACADDR=02:01:02:03:04:08

Do the following to make sure all changes are applied:
sudo ifdown eth0 (warning: you will lose connectivity on this interface when you run this command, so make sure you are able to access your computer either via console or through another interface to run the rest of the commands)
sudo ifup eth0
sudo service network restart

Friday, October 22, 2010

Firefox pdf viewer plugin (Solved)

The error:

LoadPlugin: failed to initialize shared library ../.mozilla/plugins/nppdf.so [../.mozilla/plugins/nppdf.so: wrong ELF class: ELFCLASS32]

Solution:

Make sure you have nspluginwrapper installed:

sudo apt-get install nspluginwrapper

Now find the nppdf.so file that came with Reader9 (I don't know the exact path off the top of my head, so do a search for it if you can't find it)

sudo nspluginwrapper -i path_to/nppdf.so

java alternative how to

Original source from here: Finally, Sun release 64 Bit Browser Plugin Support for JRE (almost)

To install JRE6 u12 as the default Java for the system, simply run the following two commands:

 sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jre1.6.0_12/bin/java" 1
sudo update-alternatives --set java /opt/java/jre1.6.0_12/bin/java



Following the execution of both commands, there should be output along the lines of:
Using '/opt/java/jre1.6.0_12/bin/java' to provide 'java'

cdsdoc libpthread.so.0: cannot open shared object file (Solved)

Hi
When running "cdsdoc &" i get this error:

$INST_DIR/tools/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

Solution:

I changed the cdsdoc script from $CDS_ROOT/share/bin/cdsdoc the LD_ASSUME_KERNEL from 2.4.19 to 2.6.19

The test:
lnx#> cdsdoc -test

               CDSDoc 2.1 Installation verification

Check system - Linux ws4 2.6.31.14-0.2-xen #1 SMP 2010-10-07 19:06:53 +0200 x86_64 x86_64 x86_64 GNU/Linux
Checking installation directory... Done.
Checking user environment variables... Done.
Checking Netscape, make sure Netscape 4.51 (or higher) is in your PATH ...
Mozilla Firefox 3.5.4, Copyright (c) 1998 - 2009 mozilla.org
Java version 1.6.0_21 used, It should be java 1.1 or newer version
Checking Directory Structure...
Directory Structure Check passed
Done.

Friday, October 1, 2010

How to test internal network speed? (solution?)

Hi, if you don't know about iperf - profi network speed testing then you can use this alternative.
===>
I need to know what is the network speed between two computers and solved such way:

1. started sending data from /dev/zero with "pv /dev/zero | netcat -v -l -p 3333"






2. Then on the client started to receive the data:

lnx_client #> netcat -v ws2 3333 > /dev/null
where ws2 is the server that listen on 3333

3. Tested on server the connection between them:
lnx_srv #> watch "netstat -tn | grep -i 3333"







4. The speed can be read here:






Tuesday, September 7, 2010

VirtualBox bios time offset (how to)

Q: Is there a way to set the virtual bios time on a time and date of my choice, and can I have the additions installed with that sync tool deactivated somehow?

A: You can set a time offset in VBox 1.4.0:

VBoxManage modifyvm <name> -biossystemtimeoffset <msec>

Original source from here

Friday, September 3, 2010

FlexLM License Server

lmutil - Copyright (c) 1989-2008 Acresso Software Inc. All Rights Reserved.
usage: lmutil lmborrow -status
lmutil lmborrow -clear
lmutil lmborrow {all|vendor} dd-mmm-yyyy:[time]
lmutil lmborrow -return [-c licfile] [-d display_name] [-fqdn] feature
lmutil lmdiag [-c licfile] [-n]
lmutil lmdown [-c licfile] [-q] [-all] [-vendor name] [-force] [-help]
lmutil lmhostid [-internet|-user|-display|-n|
-hostname|-hostdomain|-string|-long]

lmutil lminstall [-i infile] [-o outfile]
[-overfmt {2, 3, 4, 5, 5.1, 6, 7.1, 8}]
[-odecimal] [-maxlen n]
lmutil lmnewlog [-c licfile] vendor new-file, or
lmutil lmnewlog [-c licfile] feature new-file
lmutil lmpath -status
lmutil lmpath -override {all | vendor } path
lmutil lmpath -add {all | vendor } path
lmutil lmremove [-c licfile] feature user host display
lmutil lmremove [-c licfile] -h feature host port handle
lmutil lmreread [-c licfile] [-vendor name] [-all]
lmutil lmswitchr [-c licfile] vendor new-file, or
lmutil lmswitchr [-c licfile] feature new-file
lmutil lmstat [-c licfile] [lmstat-args]
lmutil lmswitch [-c licfile] vendor new-file, or
lmutil lmswitch [-c licfile] feature new-file
lmutil lmver flexlm_binary
lmutil -help (prints this message)
lmutil utility_name -help (display detailed usage information)

Friday, July 16, 2010

Free time with geometry

How to divide angle in three equal parts?


The common segment that divide two different segments?

How to draw a square with area equal with the area of circle?

How to graphically find length of a circle?

Can you understand another my aberration from below? (10x u)

Wednesday, July 14, 2010

running Calibre Xlib error (solved)

Hi

I'm trying to start Calibre (OpenSuse 11.1) and get such errors:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Application initialization failed: couldn't connect to display ":0.0"

Solution:

run before starting Calibre this command:
xhost +

Note: for more details see the "man xhost" (I know you know how to linux)

Wednesday, June 16, 2010

how to crontab FlexLM autostart server (Cadence license server start at reboot)

This was done in Mandriva:

#> cd /var/spool/cron
#> mkdir reboot
#> vi /etc/crontab

# edit the crontab as folow:
02 4 * * * root nice -n 19 run-parts --report /etc/cron.daily
etc. ... other 2 lines like the above
# here add this line
@reboot root nice -n 19 run-parts --report /var/spool/cron/reboot

# exit the vi

in directory /var/spool/cron/reboot create a executable script that start the Cadence server (don't forget, chmod a+x your_script)

Example: of "cadsrv" file placed in /var/spool/cron/reboot
#> cat cadsrv

#!/bin/tcsh

cd /flexlm/
./lmgrd -c cadence.dat -l lic.log
# end of the script

as root:
service crond start
chkconfig crond on

NOTE: now after reboot the Cadence license server should start automaticaly

Uff, my administrator life become more confortable, thank you :)

Monday, June 14, 2010

FlexLM Server -> Failed to open the TCP port number in the license

The problem was that /etc/hosts should have this line:

127.0.0.1 localhost

:) Enjoy

tcsh commands how to ...

Original source from here

cmd &
Execute cmd in background.

cmd1 ; cmd2
Command sequence; execute multiple cmds on the same line.

(cmd1 ; cmd2)
Subshell; treat cmd1 and cmd2 as a command group.

cmd1 | cmd2
Pipe; use output from cmd1 as input to cmd2.

cmd1 `cmd2`
Command substitution; run cmd2 first and use its output as arguments to cmd1.

cmd1 || cmd2
OR; execute either cmd1 or (if cmd1 fails) cmd2.

cmd1 && cmd2
AND; execute cmd1 and then (if cmd1 succeeds) cmd2.

===========================================

cmd > file Send output of cmd to file (overwrite).

cmd >! file
Same as preceding, even if noclobber is set.

cmd >> file Send output of cmd to file (append).

cmd>>! file
Same as preceding, even if noclobber is set.

cmd < file Take input for cmd from file. cmd << text Read standard input up to a line identical to text (text can be stored in a shell variable). Input usually is typed on the screen or in the shell program. Commands that typically use this syntax include cat, echo, ex, and sed. If text is enclosed in quotes, standard input will not undergo variable substitution, command substitution, etc.

===========================================

cmd >& file
Send both standard output and standard error to file.

cmd >&! file
Same as preceding, even if noclobber is set.

cmd >>& file
Append standard output and standard error to end of file.

cmd >>&! file
Same as preceding, even if noclobber is set.

cmd1 |& cmd2
Pipe standard error together with standard output.

(cmd> f1) >& f2
Send standard output to file f1 and standard error to file f2.

cmd | tee files
Send output of cmd to standard output (usually the screen) and to files. (See the example in Chapter 3, "Linux Commands" under tee.)

Saturday, June 12, 2010

How to enable Skype sound OpenSuse 11.2

ENVRIONMENT: ALSA 1.0.9 or later
Skype 1.1.0.13 or later
Linux kernel 2.6.x (SUSE Linux 9.1 or later)

PROBLEM: Skype blocks my sound system on SUSE, why?

SOLUTION: Skype, the free VOIP software uses OSS (Open Sound System), which it reserves the whole sound system for itself. There are many work arounds for this. You can use ALSA directly, or through wrappers such as aRts. Here I will show how to do it with ALSA (Advanced Linux Sound Architecture).

First, you need to copy and paste the script provided below and add it to your /etc/asound.conf file.

After that, when you want to start the software, type aoss skype at a command prompt to start the software.

That's how easy, happy skyping!

EXAMPLE: Contents of the /etc/asound.conf script:

pcm.asymed {
type asym
playback.pcm "dmix"
capture.pcm "dsnoop"
}
pcm.!default {
type plug
slave.pcm "asymed"
}
pcm.!dmix {
type dmix
ipc_key 1024
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 48000
}
bindings {
0 0
1 1
}
}
pcm.!dsnoop {
type dsnoop
ipc_key 5778293
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
period_time 0
period_size 128
buffer_size 2048
format S16_LE
rate 48000
}
}

Tuesday, June 8, 2010

user file directory hdd stat to log file

====

du -k /home-nis/userName/* | sort -nr | cut -f2 | xargs -d '\n' du -sh > v.log

Output sample from the v.log (saved output to file) -> ...

#> cat v.log

3.9G /home-nis/vitalie/Documents
3.1G /home-nis/vitalie/Documents/Microsoft.Student.With.Encarta.Premium.2009-XiSO
2.6G /home-nis/vitalie/downloads
299M /home-nis/vitalie/workspace
205M /home-nis/vitalie/workspace/VDRC_NEXT

etc ...

Thank you

:)

----------------------
Suse - name meaning, origin

from this site

The girl's name Suse \s(u)-se\ is a variant of Susan (Hebrew), and the meaning of Suse is "lily".

The baby name Suse sounds like Suze, Susy, Susie, Susi and Susee. Other similar baby names are Sue, Ase, Gus, Sile, Dusa, Lise, Lyse, Lusa, Luise, Luce, Rise, Rose, Sade, Sage, Sasa, Sine, Sula, Skie, Sukie, Sukey, Suky, Sukee, Suri, Suzy, Suzie, Suzi, Suzee and Suzu.

:)
----------------------
Debian :)


from this site

The name Debian comes from the names of its founder, Ian Murdock, and his wife, Debra. The word "Debian" is thus pronounced as the corresponding syllables of these names are in American English: /deb' ē ən/.

----------------------
Mandriva, mandrake ...?

from this site

#

1. A southern European plant (Mandragora officinarum) having greenish-yellow flowers and a branched root. This plant was once believed to have magical powers because its root resembles the human body.
2. The root of this plant, which contains the poisonous alkaloid hyoscyamine. Also called mandragora.

----------------------

etc. ... :) and so on ...

(how to if) sudo: command not found

man sudo have "-s" option (run command)

Respond:
mem@nano:~> sudo xm list
sudo: xm: command not found

with "-s" option ->
mem@nano:~> sudo -s xm list
Name ID Mem VCPUs State Time(s)
CentOs4.8x86_64 7 1024 4 -b---- 915.4
Domain-0 0 7044 4 r----- 4674.8

Wednesday, June 2, 2010

Fedora 13 ssh with NIS users login problem (solved)

Hi

Installed the Fedora 13, configured the NFS and NIS client.
When trying to login got this message:

"Could not chdir to home directory /home-nis/userName: Permission denied"

Solution:

Need to disable the SeLinux from Fedora. To do so in terminal run this as root ->

lnx#> echo 0 > /selinux/enforce

P.S.: you should permanently disable selinux ->
lnx#> vi /etc/selinux/config

and change this line

SELINUX=enforcing

with:

SELINUX=disabled


See ya on the next topic ;)

Monday, May 31, 2010

Funny WiFi test (free time spend at workplace)



Antenna, you allready know all about it ... if no, "google is our best friend" (I hear that from my brather)




Connection to the computer ... (i'm trast in you, be carefull => 220 V is connected to the case)





All wifi stations recieved with the antenna!




Gain graphs for WiFi stations ...




Workplace, where the test was done succesfully! :)

Thursday, May 27, 2010

Mandriva, Cadence-># virtuoso: command not found (solved)

Hi

Cadence virtuoso in terminal show this error:

lnxMandriva#> virtuoso
virtuoso: command not found

Solution:
install "ksh"
#> sudo urpmi ksh
#> sudo su
root#> cd /bin
root#/bin> ln -s /bin/ksh93 ksh
root#/bin> urpmi -a compat


Note: if you get such error messages (see below or link) then add this to /etc/X11/xorg.conf
======
Resource id: 0x4200011
Qt Warning: X Error: BadWindow (invalid Window parameter) 3
Major opcode: 18 (X_ChangeProperty)
Resource id: 0x4200011
Qt Warning: X Error: BadWindow (invalid Window parameter) 3
Major opcode: 18 (X_ChangeProperty)
Resource id: 0x4200011
Qt Warning: X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20 (X_GetProperty)
etc. ...
=====

Add following to your xorg.conf:

Section "Extensions"

Option "Composite" "Disable"

EndSection

Friday, May 21, 2010

Mandriva nis client desktop login problem (solved)

Hello,
When trying to login into user nis desktop  account I  get-> "Login failed"
Solution:
Changed the /etc/pam.d/system-auth ->

#%PAM-1.0

auth        required      pam_env.so
#auth        sufficient    pam_tcb.so shadow nullok prefix=$2a$ count=8
auth        sufficient    pam_unix.so try_first_pass likeauth nullok
auth        required      pam_deny.so

#account     sufficient    pam_tcb.so shadow
account     sufficient    pam_unix.so
account     required      pam_deny.so

password    required      pam_cracklib.so try_first_pass retry=3 minlen=4  dcredit=0  ucredit=0
#password    sufficient    pam_tcb.so use_authtok shadow write_to=shadow nullok prefix=$2a$ count=8
password    sufficient    pam_unix.so try_first_pass use_authtok nullok md5 shadow
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
#session     required      pam_tcb.so
session     required      pam_unix.so
#

Thursday, April 1, 2010

Remote Administration (VNC) OpenSuse 11.2 show black screen (solved)

Hi
When try to connect with vncviewer on Remote Administration enabled on OpenSuse 11.2 it show a black screen.
The solution:
- comment this line in "/etc/hosts"
#special IPv6 address
::1 localhost ipv6-localhost ipv6-loopback
P.S.: One important note, if enabled compiz,  remote user desktop will freeze :)
Enjoy.

How to enable microphone in OpenSuse 11.2

Hi

To enable microphone in OpenSuse 11.2 open a terminal and run:

lnx:> kmix

Then, from the right bottom, right click the sound, show mixer, Settings -> Configure etc ... .:
Enjoy.

Monday, March 1, 2010

Configure Multiple IP Address on a Cisco Router Interface

Original source from here

Cisco IOS supports multiple IP Addresses on an interface. There will be one Primary IP Address on the interaface and multiple Secondary IP Addresses on the interface. There is no limit on the number of IP Addresses that can be configure on an interface. Configurng multiple IP Addresses on your cisco routers can sometime help where you have multiple subnets having one physical router interface.

The IP Addresses can be from different subnets and from different networks.

To configure multiple IP Addresses,

Configure primary IP Address

From the Interface configuration mode, configure the primary IP Address

ciscorouter# conf term
ciscorouter(config)# int fa0/0
ciscorouter(config-if)# ip address 172.20.20.1 255.255.255.0
That configures the primary IP Address.

Configure Secondary IP Address

Now, add the required secondary IP Addresses onto the same interface

ciscorouter(config-if)# ip address 172.20.21.1 255.255.255.0 secondary
This adds the additional IP Address onto the interface. In the command above, the keyword "secondary" at the end defines the additional IP Address as a secondary IP Address.

How the Routing should be then?

Original source from here

=============

The easiest way to configure multiple routes on the same interface is to use the secondary IP command.

How do I add a static route into my Cisco router?
- Pretty simple
router# config t ; get into the configuration mode
router(config)# ip route A.B.C.D (destination network/host) A.B.C.D (mask) A.B.C.D (next hop); this is a simple static route

Example: -->>

Router 1
!
interface serial 0
ip address 192.0.0.1 255.255.255.0
ip address 192.0.0.2 255.255.255.0 secondary ! second route on same interface

interface serial 1
ip address 192.1.0.1 255.255.255.0
ip address 192.1.0.2 255.255.255.0 secondary

ip route 200.2.0.0 255.255.255.0 196.0.0.4; goes to serial 0
ip route 200.2.0.0 255.255.255.0 196.0.0.5; goes to serial 0
ip route 200.2.0.0 255.255.255.0 196.1.0.4; goes to serial 1