Archive for Linux

how to auto refresh a file that open by vi command

i would like to monitor a file called fileA. A program will write into this files. how could I auto refresh the fileA that open by vi command?




LinuxQuestions.org

1984 happening for real?

It seems popular all over the world to come up with some intrusive laws (SOPA,PIPA,ACTA). Now it’s UK’s turn:

http://www.telegraph.co.uk/technolog…-spy-plan.html




LinuxQuestions.org

LXer: ABLEconf 2012 schedule online

Published at LXer:

ABLEconf’s schedule for the Saturday March 24th event includes Linux performance tuning, mobile device forensics, technical recruiting, resume writing strategies for tech and big data.

Read More…




LinuxQuestions.org

Laptop monitor shuts off when attempting to switch to external monitor (Debian)

Hi,
I’m running Debian Squeeze on a semi-ancient Acer Aspire 5920G, having recently moved from Fedora. One of the issues that I’ve been struggling with is that whenever I plug in an external monitor, and then try to switch monitors (by pressing Fn+F5 in my case), the laptop monitor goes black. It doesn’t seem to just be the case of the monitor because using keybindings to access the terminal, typing sudo reboot followed by my password doesn’t work either (obviously this is all done in the dark, but after n attempts it becomes quite clear that it’s not working). I thought that maybe Debian had bound my Fn+F5 combo to something else, but entering the monitor settings and manually "enabling" the external monitor triggers the same effect. I first thought that maybe this was the consequence of me mucking about with the proprietary video drivers, but I’m currently running the free ones and the problem persists.

Any thoughts on this would be splendid, as whenever I hit the Fn+F5 combo I always have to do a hard reboot whenever the monitor turns off, so it takes some time to go through a process of trial and error!

Cheers,
Sid




LinuxQuestions.org

warcraft3 (using wine)doesn’t run on linux

When i run the game it only runs the menu,but when it is loading to play, the bar stops at half and send me to the desk, changing too the graphical environment from 1024×768 to 800×600.
I use an IBM ThinkPad t23,pentium 3 processor, 1.3Ghz, 256mb of RAM.
the operating system is Lubuntu 10.11 and the graphical environment is openbox.
I use wine to run the program.




LinuxQuestions.org

‘Cinnamon’ GNOME 3 fork now ‘fully stable’ with version 1.2

The Linux Mint team announced a “fully stable” version of its “Cinnamon” fork of GNOME 3.x. Available for several major Linux distributions, Cinnamon 1.2 is more customizable than GNOME 3.x, restores much of the GNOME 2.x interface, and adds features such as desktop effects and layout options.
DesktopLinux.com

Red Hat unveils 10-year support plan

Red Hat has extended the life cycle of Red Hat Enterprise Linux (RHEL) 5 and 6 from seven to 10 years, with RHEL 6 now supported through 2020. Meanwhile, Linux kernel maintainer Greg Kroah-Hartman left Red Hat rival SUSE to join the Linux Foundation as a fellow.
DesktopLinux.com

DesktopLinux.com acquired …

DesktopLinux.com’s publisher, Ziff-Davis Enterprise, has been acquired by a Californian company — as yet undisclosed, but rumored to be Foster City-based QuinStreet. Future plans for the site have not yet been announced …

At this point, the future of DesktopLinux.com is uncertain. What we can say
DesktopLinux.com

Fuse on RedHat

Hi guys,
I’m trying to install Fuse on RedHat but yum always returns "No packages found" message.
Can anyone guide me about the yum repository structure on Redhat? Or in other words, where to place packages so yum can find them for installation.

On CentOS everything went as planned but RH gives me a headache….

Thx in advance!
drIggy




LinuxQuestions.org

python, trying to write multiple variables to a file on single line

Trying to capture 2 variables from user input, then write them to a file on the same line.

Code:

#!/usr/local/bin/python
# Get raw input from command line.
word1 = raw_input("Pick a noun: ")
word2 = raw_input("Describe it: ")
#Open txt file for writing
outfile = open('/python/EXAMPLES/simpletext.txt','w')

outfile.write('Running script\n')
outfile.write(word1, word2)


Quote:

$ ./open-write-to-file.py
Pick a noun: cat
Describe it: is cool
Traceback (most recent call last):
File "./open-write-to-file.py", line 9, in <module>
outfile.write(word1, word2)
TypeError: function takes exactly 1 argument (2 given)


outfile.write(‘Running script\n’)
words = word1 + word2
outfile.write(words)

Is as close as I got but the formatting isn’t right.

Would also like a space between selection, and a newline at the end.

Thanks




LinuxQuestions.org

perl – strange behavior string decrement

Why does perl increment a string with behavior you might expect, but operates differently when decrementing:

Code:

#!/usr/bin/perl
use strict;
use warnings;

my $ abc = "abc";

print $ abc . "\n";
for my $ i (1..10) {
        print ++$ abc . " ";
}
print "\n";
for my $ i (1..10) {
        print --$ abc . " ";
}
print "\n";


Code:

$ ./string.pl
abd abe abf abg abh abi abj abk abl abm
-1 -2 -3 -4 -5 -6 -7 -8 -9 -10





LinuxQuestions.org

Ubuntu 12.10 will bypass menus via predictive search

Canonical unveiled a search-oriented Head-Up Display (HUD) interface that will debut in Ubuntu 12.04. Aiming to reduce dependence on menus and eventually replace them with the help of gesture and voice interactions, HUD could find its way into future versions of Ubuntu designed for smartphones and TVs.
DesktopLinux.com

KDE 4.8 adds adaptive power management, new windowing tricks

Version 4.8 of the KDE desktop environment and software bundle was released, featuring improved, adaptive power management and new windowing layouts. KDE 4.8 is also faster and more stable, and offers new features like Qt Quick-based Plasma widgets and the KDE Telepathy IM framework, says the community.
DesktopLinux.com

Microsoft is looking for a Linux expert. I need to go to the toilet.

Quote:

SR Software Development Engineer (SDE) Job

Date: Jan 22, 2012

Location: Redmond, WA, US
Job Category: Software Engineering: Development
Location: Redmond, WA, US
Job ID: 764856-52821
Division: Server & Tools Business

The primary responsibilities for this position are the following:

Define and scope open source projects designed to enable Linux on Microsoft?s virtualization and cloud platforms

Work directly with the Linux kernel community to develop Linux device drivers and kernel technology to support Linux on Microsoft platforms

Work with Microsoft product groups to help ensure the design and implementation of Microsoft virtualization and cloud technology will support Linux architectures and runtime paradigms.

The skills needed for this position to support primary responsibilities are a demonstrated ability to:

Create and implement plans that provide for the testing and quality assurance of software products

Write high-quality Linux kernel code in the C programming language and the associated unit tests.

Lead and coordinate multi-disciplinary teams to complete well-defined work efforts

Identify and solve problems that to threaten to prevent or delay the completion of a software development project

Work well with others in a team environment

Coach and/or mentor less experienced team members in a positive and constructive manner

Communicate effectively, especially the status and progress of ongoing work efforts.


http://www.microsoft-careers.com/job…98052/1405401/




LinuxQuestions.org

Red Hat, Ubuntu, and Arch Linux patch Linux kernel exploit

Canonical, Red Hat, and Arch Linux have released patches that fix a vulnerability in Linux kernels 2.6.39 and above that enable attackers to gain system root access. The distro patches followed a kernel patch to fix the vulnerability, but proof-of-concept exploit code examples have already been posted.
DesktopLinux.com

Help Please : phy0 -> rt2x00usb_vendor_request: Error – Vendor Request 0×07 failed

Hi LQ

I have been for one month a go with a problem that puled my hear for hours and couldn’t find a solution to it, I made tons of Googling for that issue and with no luck at all, the seem problem return again and again randomly.

I have kernel 2.6.39-4 which is known as stable, a USB adapter with chipset rt3070. I succeded to compile and install both driver rt2800usb from one side and the rt5370sta from an other side. To run one of them I just blacklist the other one and then modprobe xxx … yesterday I was able to browse the net with the rt2800usb normally, but suddenly after reboot when I plug the usb adapter I get a dirthy message saying :

[ 281.688657] phy0-> rt2x00usb_vendor_request: Error – Vendor Request 0×07 failed for offset 0×0580 with error -71

The message is getting repeating in dmesg for many times, I didn’t succeed to make the usb adapter work until now, always show me this error message, I tried switching to rt5370sta but no luck, tried to update the firmware and whatever I do I don’t succeed at all, searched the net I have seen people setting hung_task_timeout_secs to 0, I did that reboot but nothing happing seem message always appear, I don’t see anymore wlan0 or ra0 when tipping ifconfig, this command break many times as well and the system console refuse to respond when I plug the usb wireless so I was forced to open a new terminal tab … really frustrating problem.

:banghead:

Any solution to that ? I don’t think so but if someone knows please to tell me what should I do.

A@




LinuxQuestions.org

Help Please : phy0 -> rt2x00usb_vendor_request: Error – Vendor Request 0×07 failed

Hi LQ

I have been for one month a go with a problem that puled my hear for hours and couldn’t find a solution to it, I made tons of Googling for that issue and with no luck at all, the seem problem return again and again randomly.

I have kernel 2.6.39-4 which is known as stable, a USB adapter with chipset rt3070. I succeded to compile and install both driver rt2800usb from one side and the rt5370sta from an other side. To run one of them I just blacklist the other one and then modprobe xxx … yesterday I was able to browse the net with the rt2800usb normally, but suddenly after reboot when I plug the usb adapter I get a dirthy message saying :

[ 281.688657] phy0-> rt2x00usb_vendor_request: Error – Vendor Request 0×07 failed for offset 0×0580 with error -71

The message is getting repeating in dmesg for many times, I didn’t succeed to make the usb adapter work until now, always show me this error message, I tried switching to rt5370sta but no luck, tried to update the firmware and whatever I do I don’t succeed at all, searched the net I have seen people setting hung_task_timeout_secs to 0, I did that reboot but nothing happing seem message always appear, I don’t see anymore wlan0 or ra0 when tipping ifconfig, this command break many times as well and the system console refuse to respond when I plug the usb wireless so I was forced to open a new terminal tab … really frustrating problem.

:banghead:

Any solution to that ? I don’t think so but if someone knows please to tell me what should I do.

A@




LinuxQuestions.org

Shorewall Blacklisting help

Greetings

I have been trying to blacklist some IP addresses on my 13.37 slackware setup on my home laptop.

Here is what I have on each of my configuration files of shorewall:

/etc/shorewall/interfaces:

Code:

#ZONE        INTERFACE        BROADCAST        OPTIONS
net      wlan0          detect                blacklist,dhcp
net        eth0                detect                blacklist,dhcp


/etc/shorewall/zones:

Code:

#ZONE        TYPE                OPTIONS                IN                        OUT
#                                        OPTIONS                        OPTIONS
fw        firewall
net        ipv4


/etc/shorewall/policy:

Code:

#SOURCE                DEST                POLICY                LOG        LIMIT:                CONNLIMIT:
#                                                LEVEL        BURST                MASK
fw                    net            ACCEPT
net            all            DROP                info
all                all                REJECT                info


/etc/shorewall/shorewall.conf

Code:

###############################################################################
#
#  Shorewall Version 4 -- /etc/shorewall/shorewall.conf
#
#  For information about the settings in this file, type "man shorewall.conf"
#
#  Manpage also online at http://www.shorewall.net/manpages/shorewall.conf.html
###############################################################################
#                      S T A R T U P  E N A B L E D
###############################################################################

STARTUP_ENABLED=Yes

###############################################################################
#                              V E R B O S I T Y
###############################################################################

VERBOSITY=1

###############################################################################
#                                L O G G I N G
###############################################################################

BLACKLIST_LOGLEVEL=

LOG_MARTIANS=Yes

LOG_VERBOSITY=2

LOGALLNEW=

LOGFILE=/var/log/messages

LOGFORMAT="Shorewall:%s:%s:"

LOGTAGONLY=No

LOGLIMIT=

MACLIST_LOG_LEVEL=info

RELATED_LOG_LEVEL=

SFILTER_LOG_LEVEL=info

SMURF_LOG_LEVEL=info

STARTUP_LOG=/var/log/shorewall-init.log

TCP_FLAGS_LOG_LEVEL=info

###############################################################################
#        L O C A T I O N          O F        F I L E S  A N D  D I R E C T O R I E S
###############################################################################

CONFIG_PATH="/etc/shorewall:/usr/share/shorewall"

IPTABLES=/usr/local/sbin/iptables

IP=/sbin/ip

IPSET=/usr/sbin/ipset

MODULESDIR=

PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"

PERL=/usr/bin/perl

RESTOREFILE=restore

SHOREWALL_SHELL=/bin/sh

SUBSYSLOCK=/var/lock/subsys/shorewall

TC=

###############################################################################
#                D E F A U L T  A C T I O N S / M A C R O S
###############################################################################

ACCEPT_DEFAULT=none
DROP_DEFAULT=Drop
NFQUEUE_DEFAULT=none
QUEUE_DEFAULT=none
REJECT_DEFAULT=Reject

###############################################################################
#                        R S H / R C P  C O M M A N D S
###############################################################################

RCP_COMMAND='scp $ {files} $ {root}@$ {system}:$ {destination}'
RSH_COMMAND='ssh $ {root}@$ {system} $ {command}'

###############################################################################
#                        F I R E W A L L          O P T I O N S
###############################################################################

ACCOUNTING=Yes

ACCOUNTING_TABLE=filter

ADD_IP_ALIASES=No

ADD_SNAT_ALIASES=No

ADMINISABSENTMINDED=Yes

AUTO_COMMENT=Yes

AUTOMAKE=No

BLACKLISTNEWONLY=Yes

CLAMPMSS=No

CLEAR_TC=Yes

COMPLETE=No

DELETE_THEN_ADD=Yes

DETECT_DNAT_IPADDRS=No

DISABLE_IPV6=No

DONT_LOAD=

DYNAMIC_BLACKLIST=Yes

EXPAND_POLICIES=Yes

EXPORTMODULES=Yes

FASTACCEPT=No

FORWARD_CLEAR_MARK=

IMPLICIT_CONTINUE=No

IP_FORWARDING=On

KEEP_RT_TABLES=No

LEGACY_FASTSTART=Yes

LOAD_HELPERS_ONLY=No

MACLIST_TABLE=filter

MACLIST_TTL=

MANGLE_ENABLED=Yes

MAPOLDACTIONS=No

MARK_IN_FORWARD_CHAIN=No

MODULE_SUFFIX=ko

MULTICAST=No

MUTEX_TIMEOUT=60

NULL_ROUTE_RFC1918=No

OPTIMIZE=0

OPTIMIZE_ACCOUNTING=No

REQUIRE_INTERFACE=No

RESTORE_DEFAULT_ROUTE=Yes

RETAIN_ALIASES=No

ROUTE_FILTER=No

SAVE_IPSETS=No

TC_ENABLED=Internal

TC_EXPERT=No

TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"

TRACK_PROVIDERS=No

USE_DEFAULT_RT=No

USE_PHYSICAL_NAMES=No

ZONE2ZONE=2

###############################################################################
#                        P A C K E T  D I S P O S I T I O N
###############################################################################

BLACKLIST_DISPOSITION=REJECT

MACLIST_DISPOSITION=REJECT

RELATED_DISPOSITION=ACCEPT

SMURF_DISPOSITION=DROP

SFILTER_DISPOSITION=DROP

TCP_FLAGS_DISPOSITION=DROP

################################################################################
#                        P A C K E T  M A R K  L A Y O U T
################################################################################

TC_BITS=

PROVIDER_BITS=

PROVIDER_OFFSET=

MASK_BITS=

ZONE_BITS=0

################################################################################
#                            L E G A C Y  O P T I O N
#                      D O  N O T  D E L E T E  O R  A L T E R
################################################################################

IPSECFILE=zones


/etc/shorewall/blacklist:

Code:

#ADDRESS/SUBNET                PROTOCOL        PORT        OPTIONS
XXX.XXX.XXX.XXX


Where X are random numbers of an IP address of any site I want to block out.

I start shorewall:

Code:

root@slack:/etc/shorewall# shorewall restart
Compiling...
Processing /etc/shorewall/params ...
Processing /etc/shorewall/shorewall.conf...
Loading Modules...
Compiling /etc/shorewall/zones...
Compiling /etc/shorewall/interfaces...
Determining Hosts in Zones...
Locating Action Files...
Compiling /usr/share/shorewall/action.Drop for chain Drop...
Compiling /usr/share/shorewall/action.Broadcast for chain Broadcast...
Compiling /usr/share/shorewall/action.Invalid for chain Invalid...
Compiling /usr/share/shorewall/action.NotSyn for chain NotSyn...
Compiling /usr/share/shorewall/action.Reject for chain Reject...
Compiling /etc/shorewall/policy...
Compiling /etc/shorewall/notrack...
Running /etc/shorewall/initdone...
Compiling /etc/shorewall/blacklist...
Adding rules for DHCP
Compiling Kernel Route Filtering...
Compiling Martian Logging...
Compiling MAC Filtration -- Phase 1...
Compiling MAC Filtration -- Phase 2...
Applying Policies...
Generating Rule Matrix...
Creating iptables-restore input...
Shorewall configuration compiled to /var/lib/shorewall/.restart
Restarting Shorewall....
Initializing...
Processing /etc/shorewall/init ...
Processing /etc/shorewall/tcclear ...
Setting up Route Filtering...
Setting up Martian Logging...
Setting up Proxy ARP...
Setting up Traffic Control...
Preparing iptables-restore input...
Running /usr/local/sbin/iptables-restore...
IPv4 Forwarding Enabled
Processing /etc/shorewall/start ...
Processing /etc/shorewall/started ...
done.


And then run this command to see if there is anything blacklisted:

Code:

root@slack:/etc/shorewall# shorewall list blacklst
Shorewall 4.4.27 Chain blacklst at slack - Mon Jan 23 02:15:44 EET 2012

Counters reset Mon Jan 23 02:14:19 EET 2012

Chain blacklst (4 references)
 pkts bytes target    prot opt in    out    source              destination       
    0    0 reject    all  --  *      *      XXX.XXX.XXX.XXX      0.0.0.0/0


But when I try to visit this IP from my web browser I can still get in. What am I doing wrong?

Thanks in advance




LinuxQuestions.org

Linux gains share on enterprise servers — and desktops, too

Linux jumped to 1.4 percent desktop market share from 0.97 percent in July, according to Net Applications. Meanwhile, a Linux Foundation survey on enterprise Linux says 79.8 percent of organizations are planning to increase their Linux deployments, citing affordability, technical features, and security as Linux advantages.
DesktopLinux.com

Disabling disk quota warnings in linux

Hi,

I am runing Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64).

I recently activated user quota limits (soft and hard limits).
Users now complain that the console gets filled with warning messages when the soft or the hard limit are reached.
Warning message for soft limit: dm-2: warning, user block quota exceeded.
Warning message for hard limit: dm-2: write failed, user block limit reached.

Is there a way to either disable this messages or redirect them to a file? I had a look at syslog (http://linux.about.com/od/commands/l…l5_syslogc.htm), but I do not know what "facility" is issuing these messages and what their "priority" is.

Thanks for any help! By the way, I am a newbie in linux…




LinuxQuestions.org