Linux is a free (libre), open source, Unix-like operating system.

learn more… | top users | synonyms

4
votes
1answer
20 views

Bash script to open or close gnome-terminal with a single keybinding

I wanted to bind a single hot key to open and close gnome-terminal in a way similar to terminal emulators such as tilda or guake. I use Ubuntu, and have configured this script to be executed when I ...
3
votes
2answers
22 views

Nagios plugin webdav check 2

Original post: nagios plugin webdav check According to the good advice I have received I've made some modifications to the code: ...
3
votes
2answers
38 views

nagios plugin webdav check

I have written a small plugin for nagios to check a WebDAV server. It is supposed to connect using a username and password and upload & delete a test file This is my code: ...
1
vote
2answers
46 views

Linux C Port Knock Implementation

Compile with: gcc -std=gnu11 -o "portknock" "portknock.c" -lpcap I did this as a learning experience, and it actually ended up being something useful. I made a ...
5
votes
0answers
38 views

Automated owncloud installation script

Here is a shell script which installs and configure owncloud on a Debian server. It also installs apache2 and MySQL as dependencies and fail2ban with a specific rule for owncloud. Apache2 is also ...
4
votes
1answer
107 views

Parsing a string to extract values

I am writing some C# that will be running on Linux and will extract values from a kernel generated system file that represents readings from a sensor. The file contains two lines of text, and I have ...
3
votes
2answers
72 views

Basic shell implementation

Here is a small project to implement a basic shell. It is a personal ongoing project to keep system call usage fresh. It currently does background processes and some basic signal handling. I am ...
5
votes
2answers
250 views

Cleanup and server restart script

I have written a simple script for managing our Tomcat and Apache instances for deployment. What this script basically does is, when called, it copies the ROOT.war ...
3
votes
2answers
39 views

Dockerfile to install Apache

I'm getting started with Docker, and I've set up a very simple image built from a Dockerfile. It's based FROM the ubuntu image, ...
5
votes
1answer
63 views

Constructing a simple shell from scratch

I'm actually doing my whole shell in C from scratch from a Linux computer. The thing is that I think we all do our best from creating the simplest things that can be explained easily. And I'm not sure ...
5
votes
1answer
32 views

Function to get specified key from /proc/cpuinfo

On Linux, the file /proc/cpuinfo returns a set of key-value pairs, where the key and value are separated by a colon and each pair has its own line. It's a bit more ...
1
vote
1answer
28 views

Sh script to reduce version number in opkg status file

I have written a script to reduce/lower the version number stored in opkg status file using small shell script, This will enable us to force the opkg to install same version of a Debian package again. ...
6
votes
1answer
43 views

subset of UNIX Standard tar implementation

Hi every one I recently implemented subset of ustar archiving utility as my first year programming one project and I would like to get it reviewed and if any one have anything to point out .. dir.c ...
6
votes
2answers
40 views

Implementation of the ls command with several options - follow-up 2

I've made more improvements from previous iterations and my own, including: Added the -n flag (print owner and group IDs instead of names) Eliminated some ...
6
votes
1answer
39 views

An installer for shell scripts, written in pure sh

I wrote a tiny shell script that basically installs a script into your system by copying it to someplace like /usr/local/bin, chmodding it, and adding it to your ...
11
votes
2answers
67 views

Implementation of the ls command with several options - follow-up

I've made vast improvements to my previous ls implementation, including: Added new flags: -g (omit owner listing) ...
3
votes
1answer
49 views

Async safe threadpool

I'm trying the write a threadpool that can safely be added inside a signal handler or in code forked by multithreaded code. Are there any corner cases that would cause this code to fail? What could be ...
8
votes
1answer
45 views

Automating a WordPress install

I do not have a whole lot to do over winter break, so I wrote this little script to automate a Wordpress install (currently can only install once instance) on a fresh Debian server (tested, working ...
6
votes
1answer
57 views

Notification script | from RSS to Email | Bash

This is a script that must send an email at each new article published on a specific website. Any suggestions or improvements to do? ...
15
votes
3answers
142 views

Implementation of the ls command with several options

As part of a past assignment, I've expanded on this implementation of ls to have more options available, including non-standard ones. It currently supports these ...
7
votes
5answers
642 views

XOR encryption program in C

I've written a program that encrypts files (or stdin) with a user-specified key from 1 to 255. This "encryption" is very insecure, but still a bit better than ROT13 ...
1
vote
1answer
36 views

Format conversion of localized file | xliff to csv

I need a revision for this code... it's a working code, but i'm pretty sure that can be simplified or even improved. This is for converting a normal xliff file (localization file) into a csv, having ...
5
votes
1answer
48 views

Format conversion of localization files | 3txt to xliff

I'm trying to build an xliff for localization from 3 specific files: one contains a list of IDs, the other a list of source strings and the last, a list of translated strings. Basically, each file ...
3
votes
1answer
72 views

ARP implementation

I am a beginner in C and wrote this code to implement ARP. 3 threads are present - one to respond/receive any ARP packet targeted to me, one to refresh the ARP table on a periodic basis, and one to ...
3
votes
1answer
64 views

Package management system

A short time ago, I discovered the LinuxFromScratch project. After getting a system up and working (after much struggling), I realized that if I wanted to continue using LFS, some sort of package ...
3
votes
2answers
72 views

pthread_cond_wait() based multithreaded Linux daemon skeleton

I'm trying to design a multithreaded daemon for an industrial automation related project. The daemon will be using a number of 3rd party libs like MQTT, mysql, etc.. My idea is to have worker threads ...
-1
votes
1answer
60 views

Server listening for program sockets

Essentially I have a server that will be listening for sockets in other programs seeking a connection: ...
3
votes
2answers
374 views

Complete async OpenSSL example

I am trying to create a fully async example of a client and server using SSL. I think these are the required assumptions: Connecting may require socket readability and writeability notifications. ...
4
votes
2answers
153 views

Reverse all lines in a file

The script below should open a file, read and reverse every line, then overwrite the source file. ...
3
votes
2answers
64 views

System backup on Linux - follow up

This is a follow-up to System backup on Linux. I've done a lot to my script since I asked my first question and I think I could improve a lot while doing this. The script still does the same, only a ...
6
votes
1answer
142 views

System backup on Linux

I've written this Python script to make regular backups of a Linux server. It works pretty well except that the script sometimes backups files more than one time, which is pretty strange and I don't ...
2
votes
2answers
32 views

Split redirecting to multiple files in bash

A function mycommand which runs command and: Gives me three log-files which are: *.stdout.log: everything from ...
6
votes
1answer
171 views

Basic Linux daemon

To help myself relearn C++, I'm looking at writing a simple proxy. At the moment I've got a logger, command line argument parse and simple daemon (it does nothing beyond logging). Next I'll be looking ...
1
vote
1answer
251 views

Get network interfaces on Linux

I wrote this in order to get a list of network interfaces on Linux. In the past, I have used publicly available methods from, say, ActiveState, which uses ioctl and was annoying to get working under ...
4
votes
2answers
277 views

forever.sh - should keep a process alive forever

This script's only responsibility is to keep a process alive. Forever. It's sole dependencies shall be bash and coreutils. I'm ...
5
votes
1answer
25 views

Shell Script Audio Logger

I created my first shell script. It's an audio logger that runs on the hour for an hour and restarts. Although if it is started within the hour it will only run until the end of the hour. I've added ...
3
votes
1answer
53 views

GRE Tunnel Script

I've made this script above for GRE Tunnels and I'd like to know how I can improve it. Also, at the bottom, you'll see "Do you want to forward more ports." I want an easier method of asking this and ...
11
votes
1answer
129 views

Callback in Linux kernel driver in order to hide device's low-level protocol

I'm am writing a Linux kernel driver for HD44780 LCDs connected via I2C bus. In my last change I tried to decouple low-level code (which talks to the device via I2C) from device's logic (printing ...
2
votes
2answers
130 views

A basic C Shell for Linux

I have written a basic C Shell. It features the builtins cd, programmer, ver and ...
9
votes
3answers
547 views

Daemonizer in C

I am aware that the malloc is a potential memory leak, but with an execvp coming, and that never returning. The purpose is to ...
6
votes
3answers
373 views

Locating a PID based on an IP address and port

I wrote a simple Python app that is given an IP address and port and the app then finds the PID listening on that IP:PORT. I would like to hear constructive criticism regarding the bellow code. ...
8
votes
2answers
124 views

Backup Linux system to web

First I create a .tar of the root directory with all the file permissions saved and excluding all irrelevant directories (are these the right folders to be ...
3
votes
2answers
95 views

Assessment of client-server program source code

Can you assess source code of my client-server program? I would like to get an advice about design, code security etc. Thank you very much. The program does the following: Show files in ...
4
votes
2answers
237 views

Using sed regular expression to extract domain name from file

I'm learning regex with sed to extract the last field from file named "test". The method I'm trying gives desired output. Please suggest if this method Im trying is ...
7
votes
1answer
80 views

Adding support to Busybox vi for reading file from stdin

I am writing a patch for Busybox's implementation of vi, the classical command line code editor and predecessor of vim. It can ...
3
votes
1answer
52 views

Remove line numbers from shell history

I want to parse Linux history output and the commands parts only (without numbers): ...
7
votes
1answer
70 views

Detecting two keys pressed in quick succession

My computer has been having this issue where when I press a key, two key presses get registered. The goal of this program is to detect the time delta between the two keys so that I can set an ...
4
votes
1answer
52 views

Ruby script that deletes servers from Red Hat Satellite

This script uses the Red Hat Satellite v5.4 API to delete servers which are read in from a file. The servers are listed in the file by hostname but the Satellite API deletes servers by ID number. The ...
3
votes
0answers
159 views

Defining a char device driver protocol over uart at kernel level

My aim is to write a blocking char driver that return to the user space a complete protocol message from the kernel uart driver. Protocol description I'm fighting with a very bad protocol, called ...
2
votes
2answers
78 views

Set-uid root program that runs a program as the user “restrict” (follow-up)

See Set-uid root program that runs a program as the user "restrict" for context. I've written a very short program that is intended to run the program specified in its arguments (...