Labels

Android (1) Apache (1) bash (2) boost (2) C (37) C++ (5) cheatsheet (2) CLion (6) css (3) Debian (34) DL (17) dns (1) Docker (3) Dreamweaver (2) Eclipse (3) fail2ban (5) git (6) GitHub (5) Hacking (4) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (182) Mac (21) Machine Learning (1) mySQL (53) Netbeans (6) Networking (1) Nexus (1) OpenVMS (6) Oracle (4) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (2) Slackware (52) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (7) wire (1)

Wednesday, 21 April 2021

Properly stopping an application without using monit.

Issue: Application that should not have been running had been started using monit and then stopped using monit.

Tuesday, 20 April 2021

Berkeley DB db.h is missing

I go this error while trying to configure gnucobol but I have seen it before somewhere, just cant for the life of me remember where. anyway, a solution is to install the following;

libdb-dev


Saturday, 17 April 2021

HTML date picker

<label for="start">Start date:</label>
<input type="date" id="start" name="trip-start"
       value="2018-07-22"
       min="2018-01-01" max="2018-12-31">

Monday, 5 April 2021

To dump query result to a file from commandline

If we want to save the output from a MySQL session to a file, we can do this by adding the following to the end of the query;

INTO OUTFILE '/tmp/myresults.csv';

Monday, 22 March 2021

Trac on Slackware

Installation script for installing trac and it's dependencies on Slackware

Get it here: here

Note, you will need the rc.trac script, also from the above.



Thursday, 18 March 2021

Wednesday, 10 March 2021

Execute a shell command from php

To execute a shell command from php, typically do the following;

            <?php
            $output = shell_exec('sudo -u root monit summary');
            echo "<pre>$output</pre>";
            ?>

In the above scenario, we want to run something as root, so we need to modify our /etc/sudoers file;

Firstly, assuming the user is www-data then we can add the following line to /etc/sudoers

www-data ALL = NOPASSWD: /usr/sbin/monit

where /usr/sbin/monit is the command that we wish to allow the user www-data to run without the need to enter a password.



Friday, 26 February 2021