[SOLVED] crond[PID]: (root) FAILED to authorize user with PAM (Permission denied)


I have disabled root login in /etc/security/access.conf and it appears  the error message in /var/cron/log

crond[PID]: (root) FAILED to authorize user with PAM (Permission denied)

The fixed access.conf file looks like

#Allow root only from localhost and cron daemon
+ : root  : 127.0.0.1 ::1
+ : root : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6
- : root  : ALL


Enjoy!

ARDUINO: control your gate, pump just with single power button

It is often necessary to control remotely two-state devices like entrance gate, water pump, RF switch or IR switch. My idea was to keep just single on/off button and keep smallest possible leakage current.
You can see my idea on schematic below.

Windows Server - make network private

You can mark your network location on windows host as private just in three steps

1. Launch PowerShell as administrator
2. Get list of network interfaces (NICs) with command
Get-NetConnectionProfile

3. Change network category for selected network interface
Set-NetConnectionProfile -InterfaceIndex 15 -NetworkCategory Private


Enjoy!

Arduino - Easter Egg Dyeing

You know that modern eastern egg dyes requires about 5 minutes to make super bright eggs. It also takes about 5 minutes and 10 lines of code to create the countdown timer with left minute display on arduino.
The schematic diagram is more than simple. Just connect 5 or more green LEDs on ports 0-7 and one red LED on port 8.

Here is photo of my assembled board.

Is it possible to make the code shorter?!
/*
  Arduino - count down timer
*/

int MAX_LEDS = 5; // max_leds = maximun minutes
int counter = 60 * MAX_LEDS; 
bool flip_flop = LOW;

void setup() {
  
   DDRB = DDRC = DDRD = 255; // set all ports to output
   PORTD = (((unsigned int)1 << MAX_LEDS) - 1); // ON first N LEDs

   while(counter--){
    delay(1000);  // wait for a second
    flip_flop = flip_flop == LOW ? HIGH : LOW;
    digitalWrite((int)(counter/60), flip_flop); // blink current minute LED
   }

   while(true){
    delay(1000);  // wait for a second
    flip_flop = flip_flop == LOW ? HIGH : LOW;
    digitalWrite(8, flip_flop); // blink red light
   }
}

void loop() {

}

and video

Enjoy!

[SOLVED]: rhythmbox does not play mp3 file

Yes, it should play and you have already double checked  that gstreamer was installed with all possible plugins. Also was installed apt://ubuntu-restricted-extras on Ubuntu or ugly on fedora

# yum install gstreamer gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-bad-free gstreamer-plugins-bad-free-extras gstreamer-plugins bad-nonfree gstreamer-plugins-base gstreamer-plugins-good gstreamer-plugins-ugly install faad2 faac libdca wget compat-libstdc++-33 compat-libstdc++-296  xine-lib-extras-freeworld
just execute following command, which helped me a lot

# cd ~/Music
# find . -exec touch '{}' \;


Enjoy with mp3 on rhythmbox!

HOWTO: RDP from linux to windows with audio support

what you need to hear sounds on linux box connected to Windows Remote Desktop using RDP (Remote Desktop Protocol) connection?

You need linux machine with
1. Xorg
2. ALSA support (e.g. alsa-plugins-pulseaudio installed)
3. FreeRDP client

start RDP client with following command line parameters
# xfreerdp /sound:sys:alsa /u:<USERNAME> /v:<WINDOWS_HOST>


Enjoy your remote sound!

Control Kodi on Raspberry Pi with TV Remote

You don't have to buy IR receiver and remote to control your OSMC on Raspberry Pi. Yes, it's true.
Because Raspberry Pi supports HDMI-CEC and most of TVs support too.
HDMI-CEC means Consumer Electronics Control and allows to control attached devices just with single TV remote. It has also different names (please check recent revision)
AOC - E-link
LG - SimpLink
Loewe - Digital Link or Digital Link Plus
Mitsubishi - NetCommand for HDMI
Onkyo - RIHD (Remote Interactive over HDMI)
Panasonic - VIERA Link or HDAVI Control or EZ-Sync
Philips - EasyLink
Pioneer - Kuro Link
Runco International - RuncoLink
Samsung - Anynet+
Sharp - Aquos Link
Sony - BRAVIA Link or BRAVIA Sync
Toshiba - Regza Link or CE-Link

Also you need good HDMI CEC compatible cable. Cheap one transfers no signal sometimes.

Also I recommend to install Kore - Kodi/XBMC remote for Android if you own android smartphone.
Kore Main Features:

  • Control your media center with an easy to use remote
  • See what’s currently playing, including relevant information about it (movies, TV shows, music, pictures, files and addons)
  • View and manage the current playlist
  • Change and sync subtitles and audiostreams
  • View your media library, with details about movies, TV shows, music and addons
  • Control Kodi's volume with the hardware keys


Enjoy!

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...