01110100110101010101011101100010
Posts tagged Linux
multiple mouse / keyboard in linux
Oct 4th
few days ago i came upon an article about human computer interactions which mentioned different ways we interact with computes and how we will interact with computers in future, the article instantly reminded me of MPX, now i dont know how many of you remember MPX which enabled interaction of multiple mouse/keyboards in linux. Xserver 1.7 which is used in most of the disto’s was released with MPX, so i decided to find out how to make it work on my existing Fedora 13 box, and using it is pretty simple you just need to use xinput and configure X for multiple input, for that you first need to install xinput, on fedora it is provided by the package “xorg-x11-apps” just do a
[ankur@x144 ankur]# yum install xorg-x11-apps -y
and you are done, for other distro’s i guess there sould be a similar package, after the install we need to find what all is plugged in to the computer, for that we do “xinput list”
[ankur@x144 ankur]# xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ PS/2 Mouse id=14 [slave pointer (2)] ⎜ ↳ AlpsPS/2 ALPS GlidePoint id=15 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Video Bus id=6 [slave keyboard (3)] ↳ Power Button id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Laptop Integrated Webcam id=9 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)] ↳ Dell WMI hotkeys id=16 [slave keyboard (3)]
this returns a list of all the input devices, i am running this on my laptop so you can see “AlpsPS/2 ALPS GlidePoint” and “AT Translated Set 2 keyboard” which are my laptop’s mouse and keyboard, to enable multiple keyboard/mouse i will create a group and move my laptops mouse and keyboard to the group,
[ankur@x144 ankur]# xinput create-master main
[ankur@x144 ankur]# xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PS/2 Mouse id=14 [slave pointer (2)]
⎜ ↳ AlpsPS/2 ALPS GlidePoint id=15 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Video Bus id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Laptop Integrated Webcam id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]
↳ Dell WMI hotkeys id=16 [slave keyboard (3)]
⎡ main pointer id=10 [master pointer (11)]
⎜ ↳ laptop XTEST pointer id=12 [slave pointer (10)]
⎣ main keyboard id=11 [master keyboard (10)]
↳ laptop XTEST keyboard id=17 [slave keyboard (11)]
above i created a group by the name “main”, you can see a second mouse cursor on screen as soon as you do this, to make both these mouse/keyboard active i will move my laptop’s mouse (id-> 15) and keyboard (id-> 13) to this newly created group
[ankur@x144 ankur]# xinput reattach 15 10 [ankur@x144 ankur]# xinput reattach 13 11
now if i connect an external mouse and keyboard to my laptop i can see both working simultaneously, if you want multiple (more then 2) mouse and keyboards to work, you can create a separate group for them and move them to that group in a similar manner.
after doing this I was not able to find any benefit of using multiple mouse/keyboard on a laptop but it will make sense when you have multi monitor setup and multiple users trying to use the same machine simultaneously.
How Manipal got its first Linux (fedora) server
Jun 25th
It all started with a failing Student’s Teacher Feedback System, designed by few fourth year students of my college, in oct-nov 2008 the system was not able to scale and everything was reverted back to paper, it was then when i was contacted by a teacher from my Department ( Information and Communication Technology ), regarding if i can improve it.
i asked DJ if he wants to join me and after few weeks of coding there it was Manipal university’s first (working) Feedback System, when the point of hosting it came, i was surprised to find Manipal University has no Linux servers, i mean come on no Linux what are you people click sys admins, then we decided to setup our own server in the department, thus giving Manipal university its first Linux ( fedora 10 ) server.
currently it just hosts the Feedback System, but we are planning to use it as local ( internal ) fedora repository mirror, we need permission from the WiFi provider ION because almost all the students use only WiFi and not LAN, last time we tried we were denied by saying ” You are a threat to our network “, lets see how it goes this time. we will also require people to manage it but i think this can be handled very well by LUG Manipal, some pics
PS – i am looking for a way to convince them that setting up a mirror will be helpful for them as well as students can anyone suggest me how to go about it??
Using Apple Keyboard in Linux (Fedora)
Feb 19th
Few Days Ago i received my Apple Keyboard and i am enjoying typing on it, but having to hold down the Fn key then tap one of the F-keys to get F-keys working was irritating.
a simple solution to get it working just add this to your /etc/rc.local file
echo 2 > /sys/module/hid_apple/parameters/fnmodeand F-keys will start to work properly, enjoy
Update :- update for recent kernels,
ION proxy login problem
Feb 16th
a few days ago ION (WiFi provider in Manipal University) started an ISA based proxy using NTLM authentication, which according to them was a client install!!! some people were facing problem with it, like their browsers were asking for authentication (login) again and again, and repositories were not working on Linux.
So here is a simple screencast with solution for this problem it works great in Linux (esp. Fedora) i have also included configuring yum here, if someone wants to use apt-get (debian/ubuntu) they can do
export http_proxy=http://127.0.0.1:5865
Ok coming to the main point, go and download http://sourceforge.net/projects/ntlmaps/ and then watch the video here
People on windows can install python from here and then follow the steps
ION proxy problem solved
Note:- If You face any problem please post back here….
PS:- every thing in Text form coming soon… (i am lazy)
Ejecting non responding drives in Linux
Dec 10th
One of the biggest (not necessarily) problems that most (new) Linux users face is the problems of non responsive drives, espically when u insert a curropt CD / DVD which refuse to come out because something is trying to access it… or the extremely slow flash drives there are some software for it in windows like Unlocker ( dont remmember the correct name scine i dont use it ) but here we dont need any specific software we have had that feature from a long time and well its as simple as 2-3 lines on terminal and its name is ” fuser ” which is basicly used to displays the PIDs of processes using the specified files or file systems. and we can easily use it for our perpose, lets take an example suppose we need to remove the non responsing CD, for that you need to be root, do
su -
or
sudo -i
then type
fuser -k /dev/sr0
or
fuser -k /dev/cdrom0
which will kill all the process accessing that particular device, now you can easily eject the by doing
eject /dev/sr0
or
eject /dev/cdrom0
and you are done.
PS - " fuser " is useful in many more ways then just ejecting drives see " man fuser " for more info
Changing your mac address on Linux
Aug 15th
I have seen a lot of people saying that “you can never change your mac its in the hardware, you dont have access to it”, but well you can easily change you mac on Linux with a simple command Ifconfig. Which is mainly used to configure the kernel-resident network interfaces and it can help you change your mac first see your current mac type as root
ifconfig
here see your mac address in the following out put
wlan0 Link encap:Ethernet HWaddr 00:2B:B5:43:A5:12
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
where wlan0 is the network interface and ” 00:2B:B5:43:A5:12 ” is your mac address, next you need to bring the network interface down by typing
ifconfig wlan0 down
here replace wlan0 with the network interface you are using, normally it is wlan0 for WiFi and eth0 for Ethernet, now its time to change your mac address, simply type
ifconfig wlan0 hw ether 00:2B:B5:43:A5:3D
here replace 00:2B:B5:43:A5:3D with the mac ID you want to use and then bring the network interface up
ifconfig wlan0 up
now again see the output of ” ifconfig ” to check that now you HWaddr has changed from 00:2B:B5:43:A5:12 to 00:2B:B5:43:A5:3D
enjoy!!!!
PS – MAC = Media Access Control
Twit from command line (Linux)
Dec 4th
Here is a thing that i found during searching for a completely different things, you can update your Twitter status simply by using curl which is most of the time installed by default so here is the command
/usr/bin/curl -u username:password -d status="your tweet" http://twitter.com/statuses/update.xml
it simply updates your twitter status, this is extremely simple and could easily be used to update status, but the problem is that it contains your password and you dont want to display your password so you can make a simple script for it which asks you for the tweet and displays if successful or not
#!/bin/sh
echo Post your tweet.......
read tweet
/usr/bin/curl -u <username>:<password> -d status="$tweet" http://twitter.com/statuses/update.xml
if [[ "$?" == 0 ]];
then
echo Updated successfuly!!!!
exit 0
else
echo Something went wrong try again!!!!
exit 1
fi
to make it just login as root by ‘sudo -i’ or ‘su’ and type gedit /usr/local/bin/twit now paste the script and replace <username> and <password> with username and password of your twitter account and save the file, we will change the permissions for the file and make it executable by typing chmod +x /usr/local/bin/twit all done now when you want to twit just type twit on command line and let the world know what you are doing.
PS:- if you are on twitter feel free to add me http://twitter.com/ankur







