Jump to content
Forum upgrade is live! Read more... ×

Mandriva security & sudo, How I do it...

Recommended Posts

Hi, this is how I setup sudo on my system. Mandriva 2010.1 x86_64


It's been on my list to do for a while now, to publish this.


I hope it helps you decide.


I had to put it on my blog due to space requirements. (Screen shots.) It's up @LQ too.


Here's the link...




Regards Glenn

Edited by GlennsPref

Share this post

Link to post
Share on other sites

I must admitt there are some glowering omissions.


like firewall details (and kernel compilation, not required for the msec, maybe ipsec/t).


Currently I use iptables and shorewall to set ports etc.


All of these work together, and shorewall makes it very easy to configure.


Note, I do not need or have remote access, so there's a whole lot of stuff I don't need to be concerned with, I hope. (still learning)


Cheers, Glenn

Share this post

Link to post
Share on other sites

Nice little blog ... still using Mandriva 2010.1? I recently moved away from Mandriva because I expect support for the OS to drop now that the it has been cancelled. Can't wait for Mageia to release though ... I still miss Mandriva often.


But one of the things I missed about Mandriva (when I first tried out Ubuntu 10.10) was the lack of a sudoers file. I can't stand sudo myself. Why do you find it necessary to create one? Especially on a single-user system? Not saying that it's a waste of time, but it's definitely not for me. Is there some benefit to using sudo that I'm not aware of?


Can't wait for the "recording audio in realtime with a pc" blog ... I'm actually just getting to that bit myself. Not working so far (but I assume that I don't know which ALSA port to use or I have the wrong mixer daemons running under muted settings -- still new to Slackware and running on a fresh build that I'm barely familiar with). It should be a snap with Audacity ... but I believe that involves plugging the mic port to the audio output with a patch cable.

Share this post

Link to post
Share on other sites

... still using Mandriva 2010.1?

nope, 2010.2! with a bit of cooker 2011.0 for the kernel and related packages.


I expect support for the OS to drop now that the it has been cancelled

Not sure how old your info is on that, check here...


Is it curtains for Mandriva@LQ



I've tried a few distros, but it's here I'll stay for now.


uname -a

Linux GamesBox.GlennsPref.net 2.6.37-0.rc5.1mdvtmb-GamesBox #2 SMP PREEMPT Wed Dec 22 16:16:48 EST 2010 x86_64 x86_64 x86_64 GNU/Linux


My "realtime audio recording" for pc's is dated,


I'll roll a rt kernel and find some software that works and document the process. wip.


The slackers around here may know more, but look for hw:0,0 or /dev/audio0, depends on how many sound cards you have.


also pick alsa not oss (depreciated).


cheers Glenn

Share this post

Link to post
Share on other sites

Cheers for that ... never heard of Mandriva 2010.2 or 2011.0 before. Still plan on waiting for Mageia and I'll just put it on the lappy (32-bit) to see how it does before I install it to the desktop (x86_64).


Here's what I have so far on my desktop recording efforts ... perfect quality video but no sound:

$ ffmpeg -s 1920x1080 -r 30 -f alsa -i plughw:0 -f x11grab -i :0.0 -vcodec mpeg4 -qscale 1 -y 0_MyFilm.avi
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Dec 28 2010 15:33:46 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/man --enable
-libmp3lame --enable-libfaac --enable-nonfree --enable-gpl --enable-version3 --enable-postproc
 --enable-avfilter --enable-libdc1394 --enable-libfaad --enable-libgsm --enable-libopencore
-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex
 --enable-libtheora --enable-libx264 --enable-libvpx --enable-runtime-cpudetect --enable-vaapi
 --disable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib
 --enable-zlib --enable-shared --enable-static --disable-debug --arch=x86_64 --enable-pic
 --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT'
 --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -lssl -lcrypto -lz -lusb'
  libavutil	 50.15. 1 / 50.15. 1
  libavcodec	52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter	1.19. 0 /  1.19. 0
  libswscale	 0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[alsa @ 0x63a4a0]capture with some ALSA plugins, especially dsnoop, may hang.
[alsa @ 0x63a4a0]Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'plughw:0':
  Duration: N/A, start: 628.891179, bitrate: N/A
	Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[x11grab @ 0x64c3b0]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1920 height: 1080
[x11grab @ 0x64c3b0]shared memory extension  found
[x11grab @ 0x64c3b0]Estimating duration from bitrate, this may be inaccurate
Input #1, x11grab, from ':0.0':
  Duration: N/A, start: 1294101985.340168, bitrate: 1990656 kb/s
	Stream #1.0: Video: rawvideo, bgra, 1920x1080, 1990656 kb/s, 30 tbr, 1000k tbn, 30 tbc
Output #0, avi, to '0_Movie.avi':
	ISFT			: Lavf52.64.2
	Stream #0.0: Video: mpeg4, yuv420p, 1920x1080, q=2-31, 200 kb/s, 30 tbn, 30 tbc
	Stream #0.1: Audio: mp2, 44100 Hz, 1 channels, s16, 64 kb/s
Stream mapping:
  Stream #1.0 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
video:1905kB audio:28kB global headers:0kB muxing overhead 0.806764%

$ mplayer 0_MyFilm.avi
MPlayer 20100218-4.4.3 (C) 2000-2010 MPlayer Team

Playing 0_Movie.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [FMP4]  1920x1080  24bpp  30.000 fps  4333.8 kbps (529.0 kbyte/s)
Clip info:
 Software: Lavf52.64.2
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 64.0 kbit/4.54% (ratio: 8000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 1920x1080 => 1920x1080 Planar YV12 
A:   0.0 V:   0.0 A-V:  0.038 ct:  0.000   1/  1 ??% ??% ??,?% 0 0
Exiting... (End of file)

Share this post

Link to post
Share on other sites

Places to start for GNU/Linux recording. JACK and ardour. I've never bothered with an RT kernel. Not really required unless you are handling a lot of channels (ie my system doesn't even notice recording 8 channels with a bunch of others doing playback).


Although I've been forced away from a GNU/Linux setup by the need to use ProTools. I need to be able to move sessions between home and a couple of studios. I found ardour really easy to use. Jack is awesome.


Also checkout qjackctl, JAMin, JACK Timemachine (this app is very cool), or any of the many applications that support jack.

Share this post

Link to post
Share on other sites

Sorry for the massive thread hijack. Cheers for the links SledgY. I used Jack in Ubuntu and it was alright, but I prefer directing input from the listed device. This wasn't a possibility in my Ubuntu setup as there were no audio devices listed in /dev -- and even if there had been devices listed there I couldn't get root permissions to direct I/O for them. Basically, the last time I recorded both video and audio using x11grab in ffmpeg, I used the oss function (e.g. ffmpeg -f oss -i /dev/dsp).


Back on topic, I had never heard of the commands "vipw" "vigr" and "visudo" until I opened the Slackware Book. That "visudo" comment in the sudoers file shouldn't be anything to worry about.

Share this post

Link to post
Share on other sites

Jamin and ardour and jack are the same tools I use when multi-tracking. Along with some synths and sequencers, like qsynth and Hydrogen-drums.


I did not mean you "can't" use oss, just that it's being superseded.


Oss should still be in your kernel, I hope. Mine is.


Your output from mplayer confirms no audio was recorded...

A: 0.0 V: 0.0 A-V: 0.038 ct: 0.000 1/ 1 ??% ??% ??,?% 0 0

That's all I got, sorry....


p.s. make sure you are ($USER) are part of the "audio group" as well as the "video group" (probably already set).


check the $USER has permission to access the hardware...


In order to use your webcam you need to have permission to use /dev/video0.

If you use udev (which is default as of kernel 2.6.13) you only need to be in the group video. You can check it with:

$ groups

To add a user to the group run under root:

# gpasswd -a <username> video

Set permissions of the device:

# chmod 666 /dev/video0
ref. https://wiki.archlinux.org/index.php/Webcam_Setup

same deal with audio....


Audio Device may actually be /dev/dsp (digital signal processor)


are you able to record audio without video? Like a test record track?


My problems were different, I had everything and a green screen,


although that ArchLinux page sorted that for me, the page does not really go into sound.


so you might check your also config as well, with the alsa script....


alsa-info.sh info from google...

alsa-info.sh - Main Page - AlsaProject
XXXXXXXXXX` || exit 1 wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1 REMOTE_VERSION=`grep SCRIPT_VERSION $SHFILE |head -n1 |sed ...
www.alsa-project.org/alsa-info.sh - Cached - Similar
2010-02-16, Jaroslav Kysela, alsa-info.sh: Add usbmixer proc file to output ... 2009-07-19, Wu Fengguang, alsa-info.sh: include 1 line of dmesg context ...
www.alsa-project.org/alsa-info.sh.changelog - Cached - Similar

invoke the script with --help to see your options, like checking for a newer version of alsa-info.sh, and auto uploading the results and redirecting the output to a file you can read after.


Asla main page...



We have not mentioned Pulse....(?) but that may be a Mandriva thing.


see how you go, regards Glenn


my script...

#sh /home/glenn/build/sound-checking-script
echo "cat /proc/interrupts"/n
sudo cat /proc/interrupts
echo "lsmod & cat /proc/modules"/n
sudo lsmod & cat /proc/modules
echo "cat /proc/devices"/n
sudo cat /proc/devices
echo "uname -all"/n
sudo uname -a
echo "run alsa-info > /home/glenn/build/alsa-info(date).txt"/n
sudo sh /home/glenn/bin/sound/alsa-info.sh --no-upload --stdout > /home/glenn/build/alsa-info.0.4.57-`date +%Y-%m-%d-%H`.txt
echo " Available options:
#		 --with-aplay (includes the output of aplay -l)
#		 --with-amixer (includes the output of amixer)
#		 --with-alsactl (includes the output of alsactl)
#		 --with-configs (includes the output of ~/.asoundrc and /etc/asound.conf if they exist)
#		 --with-devices (shows the device nodes in /dev/snd/)
#		 --with-dmesg (shows the ALSA/HDA kernel messages)
#		 --update (check server for script updates)
#		 --upload (upload contents to remote server)
#		 --no-upload (do not upload contents to remote server)
#		 --pastebin (use http://pastebin.ca) as remote server instead www.alsa-project.org
#		 --stdout (print alsa information to standard output instead of a file)
#		 --about (show some information about the script)
#		 --debug (will run the script as normal, but will not delete /tmp/alsa-info.YOiOVMs5nP/alsa-info.txt)"		  
echo ""/n
echo "hello, $USER. script done, have a nice day" #>> /home/glenn/build/note-rpm-# 
echo "Hello, world."
uname -a
echo "listing files in the current directory, $PWD"
date && whoami
Edited by GlennsPref

Share this post

Link to post
Share on other sites

The main differences between Magia and Mandriva early 2011 will be logos and emblems.

Don't forget that it will have a totally different crowd of users. :p


Back to the audio ... it appears to be a hardware problem. Just plugged a mic into the mic ports and tested it out with alsamixer and aplay. I can get some noise when I blow on the mic but I get nothing when I speak into it. I guess I'll try it in Windows and see if it's a hardware driver issue.

/EDIT: Just got back from testing it out in Windows 7 ... works just fine over there. But in Slackware it only produces a very minimal volume even with max boost and gain:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0:  SB [HDA ATI SB], device 0: VT1818S Analog [VT1818S Analog]
  Subdevices: 1/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 0: SB [HDA ATI SB], device 1: VT1818S Digital [VT1818S Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
...Tried using plughw:0,1 in ffmpeg:
[alsa @ 0x63a4a0]cannot open audio device plughw:0,1 (No such file or directory)
...Same thing when attempting to open device hw:0,1.


I was meaning to add some comments on the gpasswd command earlier. It isn't set up by default in Slackware but it was included in the "getting started" tutorials that I shot through. Cheers.

Edited by wlayton27

Share this post

Link to post
Share on other sites

I did not mean you "can't" use oss, just that it's being superseded.

Correct that OSS was superseded. It all then gets horribly confused with a heap of finger pointing. Technically OSS 4 has once again superseded ALSA, unfortunately 4Front technologies (developer of OSS) decided to close source OSS for a period. It has since been once again open sourced (via BSD, GPL2 etc licences) but has not been reintegrated into the kernel. Looks like a bit of FUD from both sides. Personally the OSS API is easy to develop for.


One massive advantage of OSS is that the API is supported on many Unix's, not just on Linux.

Edited by SledgY

Share this post

Link to post
Share on other sites

unfortunately 4Front technologies (developer of OSS) decided to close source OSS for a period.

Let me get this straight ... Open Sound System closed its sources for a period. Isn't that by definition no longer OSS? Can I sue them for false advertising? :)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now