Run bash script as daemon

To run it as a full daemon from a shell, you’ll need to use setsid and redirect its output. You can redirect the output to a logfile, or to /dev/null to discard it. Assuming your script is called myscript.sh, use the following command: setsid myscript.sh >/dev/null 2>&1 < /dev/null & This will completely detach the … Read more

Mounting nfs shares inside docker container

Starting from docker 17.06, you can mount NFS shares to the container directly when you run it, without the need of extra capabilities export NFS_VOL_NAME=mynfs export NFS_LOCAL_MNT=/mnt/mynfs export NFS_SERVER=my.nfs.server.com export NFS_SHARE=/my/server/path export NFS_OPTS=vers=4,soft docker run –mount \ “src=$NFS_VOL_NAME,dst=$NFS_LOCAL_MNT,volume-opt=device=:$NFS_SHARE,\”volume-opt=o=addr=$NFS_SERVER,$NFS_OPTS\”,type=volume,volume-driver=local,volume-opt=type=nfs” \ busybox ls $NFS_LOCAL_MNT Alternatively, you can create the volume before the container: docker volume create \ … Read more

Installing PHP Zip Extension

This is how I installed it on my machine (ubuntu): php 7: sudo apt-get install php7.0-zip php 5: sudo apt-get install php5-zip Edit:Make sure to restart your server afterwards. sudo /etc/init.d/apache2 restart or sudo service nginx restart PS: If you are using centOS, please check above cweiske‘s answer But if you are using a Debian … Read more

Open firewall port on CentOS 7 [closed]

Use this command to find your active zone(s): firewall-cmd –get-active-zones It will say either public, dmz, or something else. You should only apply to the zones required. In the case of public try: firewall-cmd –zone=public –add-port=2888/tcp –permanent Then remember to reload the firewall for changes to take effect. firewall-cmd –reload Otherwise, substitute public for your … Read more

How to cross compile from Mac OS X to Linux x86?

Your simplest solution is to just run CentOS 5.3 in a VM (e.g. Sun VirtualBox). This requires minimal setup, has quite reasonable overhead (assuming an Intel Mac), and you’ll be able to actually test and debug what you are building. If you really insist on cross-compiling, you must build a cross-compiler. Instructions are here and … Read more

tech