Programming :: Non-root User Determine Which Days The Computer Ran?
Mar 22, 2010
Is there any way a non-root user can programmatically determine which days the computer ran during, say, the last month?
The information is in /var/log/messages.* but those files are root:root 640.
Non of the world-readable /var/log files on the Slackware 13.0 development system can be used:boot Not present if boot logging not enabled (default). dmesg No timestamps. lastlog Not enough info. wtmp Rewritten on each boot so not enough info. EDIT: not correct: by default wtmp is rotated weekly and kept for one month as configured in /etc/logrotate.conf xdm.log Not present if xdm not used. Xorg.0.log Not present if X not run.
View 5 Replies
ADVERTISEMENT
Jan 12, 2011
What functions are available on linux for a c++ program to determine if the current user is a member of a specific user group?
View 3 Replies
View Related
Jul 21, 2010
I'm trying to write a small script that will run as root, but launch a command with sudo as another user. I want that user to be whichever user is active user. That is, the user that is using GDM right now, or the one that is logged into the current console. (by current console, I don't mean the user running the script, but rather the user logged into the console currently displayed on the screen.)How can this be done?
Code:
ACTIVE_USER=`somecommand`
test `id -u pulse` -ge 1000 && sudo -u $ACTIVE_USER $*
What can I use for "somecommand"?
View 5 Replies
View Related
Jul 29, 2010
ive been unable to use my computer for almost 3 days and I need it for work.
I installed linux to my xp computer.
I have one hard drive that is 500gb
its partioned to: 440gb {XP} + 60gb {Ubuntu}
Grub will not boot to xp it only boots into linux. i mostly use xp. and even if i wanted to change to ubuntu i only have 60gb of space to do so >.<
and a further notice... i dont want to change to JUST linux.
View 9 Replies
View Related
Sep 13, 2010
See this articleIt says that win 95/98 machines wont work for more than 49.7ys continously. my question is , following the lines of above article , does linux distros (ubuntu in particular) have any such issues ?
View 1 Replies
View Related
Feb 24, 2011
I turned on my computer today (running Ubuntu 10.10) and it will go to the login screen where it shows the time at the bottom right and the restart and shutdown button, and also my computer name in the middle of the screen but it does not show my account name. My mouse and keyboard work fine there is just know where to login at. I'm still pretty new to ubuntu so I'm not to sure where to begin.
View 2 Replies
View Related
Jul 27, 2009
I've compiled some code which I've given to other people, however when they try to run it they get segemtation fault. After some testing I've found if it's ran from root (where I compiled it) everything works, if I try to run from a user there's a fault.
View 3 Replies
View Related
Jun 30, 2011
I am writing a ping kind of program for my own application. This application needs to run with non root user privileges. This needs me to create a raw socket. But the ping connection is failing because of creating raw socket with non root user.How can I run the application successfully with non root user privileges using raw socket creation?
View 4 Replies
View Related
Jan 12, 2011
I am working on a large program in C to run on Puppy Linux. I have multiple pthreads running. I want to be able to set the pthread SCHED_POLICY and priority in my program but I want a user to be able to run the program without root privilege.
Using a sticky bit and root ownership gives the user too much power because they will be able to write and compile their own scripts. Is there a way to use 'sudo' when I set the thread parameters from my program or something like this?
View 1 Replies
View Related
Jan 8, 2011
One of the feature in my application involve changing of hardware setting. This require the user to be root or have administrative right.Before my application enable that feature, I want it to check whether the user is "root" or not, or whether user use "sudo" command to run the application or not, or whether the user has administrative rights or not.What are the codes or library that can do this?
NOTE: Sometimes, advanced linux user may set the user id of root to something else other than 0. So, getuid() may not be helpful in this case.
View 4 Replies
View Related
Oct 28, 2009
Is It possible to change a process running in root-user to non-root-user by setting suid / uid / euid / gid etc... I so please instruct how, when and wat to set in order to change a process running in root-user to non-root user
View 4 Replies
View Related
Dec 7, 2010
I got a machine with RedHat Enterprise Linux 5 installed. I set the ifcfg-eth0 as following:
Code:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
when the machine rebooted, eth0 has the ip address 192.168.24.234. But if executing 'dhclient', eth0 will get the ip address 10.200.34.208, which is my expected ip address. I'm not quite familiar with networking things. I don't know what's going on there. Why should I need to execute 'dhclient' to obtain the expected ip address? Is there any way to obtain the ip address 10.200.34.208 right after host boot?
View 3 Replies
View Related
Sep 24, 2010
First, (for samba) how do I determine whether my computer "gets IP address information from a dhcp server on the network," and whether "the dhcp server provides info about WINS servers ("NetBIOS name servers") present on the network," and consequently whether a change to my smb.conf file, "so that DHCP-provided WINS settings will automatically be read from /etc/samba/dhcp.conf," and whether the dhcp3-client package must be installed?
View 2 Replies
View Related
Nov 13, 2009
We have quota system in home directory and there is binary aquota.user file.
How do i determine how much quota is assigned to a user?
View 1 Replies
View Related
Jan 3, 2011
I am new to unix, I am looking for a script to delete files older than 7 days but i also want to exclude certain directories (like arch,log .....) and also some files with extensions ike .ksh, .ch, ..............) in directories and sub directories
View 4 Replies
View Related
Aug 18, 2009
is there a way for me to grep the process that running more than 30 days only using linux command or script?
example:i do ps -ef to list out the process, then i want to filter only the process that always running more than 30 days..
View 8 Replies
View Related
Jul 31, 2011
I'm having a problem trying to customize Ubuntu 11.04 LiveCD.Everything went well until I tried to run the system updates on the LiveCD.This is the error message output:
Code:
root@lkjoel-desktop:/# sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
code....
View 3 Replies
View Related
Mar 31, 2011
I got this part from my script working that it will delete a folder is from 8 days agoEightDaysAgo=`(date --date="8 days ago" +%d-%m-%Y)`rm -rf $EightDaysAgoTarHowever I need to remove files that are older than 8days for example if the script is'nt run for a day it will remove both the 9th and 8th day one not just the 8th day one. If I'm making any sense lol
View 3 Replies
View Related
Nov 3, 2010
I want to itemize addition for each type of transactions. The example below is for 3 days,10/13/2010, 10/14/2010, & 10/15/2010.
PROD =89.25+89.25+104.47= 282.97
TAX =9.37+9.37+10.37 = 29.71
ETAX = 1+1+1 = 3
[code]...
View 8 Replies
View Related
Aug 31, 2010
When I run apps like mplayer to use my web cam it uses /dev/video#. For reason unknown to me this number changes and is usually either 1 or 0. I have looked on the Internet after struggling to find how to know which /dev/video device is used. So far I can only presume I have used the wrong terms to find how to determine which device the web cam is using.
View 5 Replies
View Related
Jul 2, 2010
Is there a library/system call that will return to me what CPU core a thread of execution is running on? I've looked for a bit on the net already and also in /usr/include and couldn't find one.
getcpu() and sched_getcpu() are two that I found, but when I include the appropriate header files (linux/getcpu.h, and sys/sched.h respectively), gcc says getcpu.h doesn't exist and the linker complains it cannot find the implementation in sched.h.
I'm sure I'm doing something really stupid or overthinking...
What I am doing is running an OpenMP application and specifying a list of cpu cores to run on with GOMP_CPU_AFFINITY. I want to make sure that each core is getting the same number of threads.
**UPDATE**
It seems that this code works, but only with glibc >= 2.6, and my machine has 2.5:
Code:
#define _GNU_SOURCE
#include <stdio.h>
#include <utmpx.h>
int main( void )
[Code].....
View 3 Replies
View Related
Mar 9, 2010
i made a program to list all the files in a directory,is there a way to determine what are directories and what are files ?
View 5 Replies
View Related
Mar 4, 2011
I have observed in a process's log file that it is receiving a number of connections from other processes running on the same box.
For example, I see lines of the following:
While I can use "netstat -tlp | egrep '5870|5871'" to see the PID of the listening process. How is it can I find out what PIDs are sending from 23870 and 23548?
View 2 Replies
View Related
Dec 3, 2009
I'm new to gStreamer and need to determine the bitrate of a stream. Has anyone here worked with this before and does anyone know how to do it?
View 1 Replies
View Related
Sep 2, 2010
Does anyone know a way (hopefully a standard/generic way, e.g. through sysfs the interface) to determine if a VGA monitor is plugged in on Linux?
View 2 Replies
View Related
Feb 5, 2011
i am having problems with privileges i have created a new user with my name, but i cant get root privileges on it. i need the same privileges as the root profile.
View 9 Replies
View Related
Oct 26, 2010
I no longer have access to my root desktop. On a session I attempted to change the root username but i apparently assigned it a wrong directory that does not exist. When I rebooted with my new root username, i was instead recognised as a simple user (no root privileges). I tried the console to change to "old" root but root password is not accepted and there is no way to access to sudoer files. it seems that inserting a new username requires root privileges and i am back to square one. Simply logging with old root username and password after restart gives me a blank screen with nothing on it and cannot even reboot.
View 9 Replies
View Related
Mar 2, 2010
i used opensuse 11.1 ...there is option for root user to create password for root...but for ubuntu i did not find anything like that...so how can i create root password....or how can i use root
View 1 Replies
View Related
Dec 2, 2010
i just installed linux mandriva 2009. i set password for root and created a user account. when i try to login as root, after logging out as user, it does not allow me and gives the error "root logins are not allowed". even it does not show the root account. if i try to go to root from konsole terminal using su root, it allows to enter as a root but when i try to start the GUI with startx it gives error.not sure what to do and why i can't see my account in GUI mode
View 5 Replies
View Related
Jun 24, 2010
I have the following which works but think there must be a easier one-liner way of doing this which involves not writing to a file but have failed to find something that works This is what I have:
Code:
du -m $i > filesize.txt
FILESIZE=$`cat "filesize.txt" | cut -f1
rm filesize.txt
I then use the FILESIZE to compare to a number.
View 3 Replies
View Related