Skip to content

Tag: linux

Python cron job file access

I have a tiny Python script that needs to read/write to a file. It works when I run it from the command line (since I am root, it will) , but when the cron job runs it cannot access the file. The file is in the same folder as the script and is (should) be created from the script. I’m

No such file or directory error in linux

Recently I have installed a program called “paradigm”. In the program path (/home/hora/Paradigm/) there is a directory “testdata” (/home/hora/Paradigm/testdata) which includes a shell script that runs an example test of the application.The first time I installed the program I was able …

Flush/Clear System.in (stdin) before reading

At work, we have 5 RFID readers attached to a PC running Linux. The readers are all recognized as keyboards and send their input (what they read form the Chip) as an key-input-event sequence. To be able to tell which reader send what sequence, I’m doing a raw-read over /dev/input/XX and get their input …

Get UTF-8 input with X11 Display

I’ve been trying and reading lots of resources on the internet, trying to find a way to get an UTF-8 keyboard (composed) input from a X Display. But I could not make it work. I have tried the example code from this link (exaple 11-4), but no success. I also have written a simple example (below) to try t…

Glassfish: How to do asadmin commands without password?

every time I enter a CLI-command for glassfish like this asadmin start-instance i1 I am prompted to enter the admin-username and admin-password. How can I disable the need for entering these credentials? I plan to write scripts for running commands like this and I think it’s not possible to enter the cr…

Move all files not starting from a specific letter

I am trying to move files from a folder to another location. I want to move all files except those which start with ‘c’. This is what I am trying Obviously this is a wrong way. Can anyone tell me the right way? I am using linux ( RHEL 6 ) Answer Since [^c] means “everything that is not c&#82…

Connect to a VPN Connection in Ubuntu in bash

How can I connect to a VPN Connection when I can use only bash (terminal)? I create a connection but I want to connect or disconnect using remote ssh connection Answer you can use nmcli to do that. this program is use for network management. you need to save the password of that connection before you use this…