Skip to content

Tag: linux

Linux Framebuffer set resolution correctly

I have a RaspberryPi and want to display an image fullscreen without xserver – so write it directly to the framebuffer. No problem here. But setting it fullscreen doesn’t work. yields: So I use resulting in If I now use fbi to display an image, or just fill the framebuffer /dev/urandom >> /d…

Get the PID of a process started with sudo via ssh

I need the process id of a process (here sleep 20) started remotely via SSH and sudo. date is inserted to illustrate the duration of the SSH connection. Without connection there is also no process on my remote machine, of course. On a second machine the last, complete command works fine: Any suggestion why th…

Protect website files on linux hosting server

l have a website that is hosted in linux server, and my root is (/home/MyAccountName). My website allows users to upload there c++/c code, compile, and execute it. The problem is: The executed user’s program will have all the owner permissions (read – write -execute). so if the user’s code i…

Sed command in linux

How do I extract URL’s from a file? My file name is URL_name.txt This file has a lot of url inside. It looks like this: Here is my idea, I want to remove everything before URLs then I can remove everything after URL. How do I use sed command deal with it? The output should be http://www.google.com/ http…

check if a file is jpeg format using shell script

I know I can use file pic.jpg to get the file type, but how do I write an if statement to check it in a shell script? E.g. (pseudo code): Answer Try (assumes Bash v3.0+, using =~, the regex-matching operator): If you want to match file’s output more closely: This will only match if the output starts wit…

‘unshare’ does not work as expected in C api

This sequence of commands works: However, the corresponding C program does not work as expected (it seems it does not unmount the previous /proc, and also it provides EBUSY trying to unmount the devpts): I omitted here error checking for readability I think that unshare or unmount does not work as expect: eve…

Protractor Js run to linux machine

I have protractor tests in my angular project, and when I would like run it i catch next exception log: And before it I see browser window with next url: data:,. UPD protractor.conf.js UPD2 If I use seleniumAddress: ‘http://localhost:4444/wd/hub’, I catch next exception: Help me please run this te…