$ sudo apt-get install smartmontools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from concurrent.futures import ThreadPoolExecutor | |
from datetime import timedelta, datetime | |
from typing import Any, Dict | |
class SimpleStorageEntry: | |
_counter: int = 0 | |
id: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codecs | |
import csv | |
import logging | |
from typing import List, Type, Union, Dict | |
from fastapi import ( | |
HTTPException, APIRouter, Request, Response, File, | |
UploadFile, ) | |
from fastapi.responses import StreamingResponse | |
from pydantic import ValidationError, BaseModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RC_FILE=~/.bashrc | |
PORT=8080 | |
NAME=nginx | |
# Check function is already defined | |
grep 'servedir' $RC_FILE > /dev/null && (echo "Function definition already exists in $RC_FILE" && exit); | |
read -d '' func <<- FUNCTION | |
servedir() { | |
docker stop $(docker ps -f Name=${NAME} -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ufw enable | |
ufw disable | |
ufw allow 8080/tcp | |
ufw status verbose | |
ufw status numbered | |
ufw delete 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=ABillS Websocket Server | |
After=network.target | |
After=mysql.service | |
Requires=mysql.service | |
[Service] | |
Type=forking | |
PIDFile=/usr/abills/var/log/websocket_backend.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONF_FILE="/etc/chilli/main.conf" | |
INTERFACE=`cat \${CONF_FILE} | grep dhcpif | awk '{ print \$2 }'`; | |
MAC=`ifconfig \${INTERFACE} | grep HWaddr | awk '{ print \$5 }' | sed s/:/-/g` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr582c5144a6bb9-trace').style.display = (document.getElementById('cakeErr582c5144a6bb9-trace').style.display == 'none' ? '' : 'none');"><b>Notice</b> (8)</a>: Undefined index: Type [<b>APP/Controller/MonitorsController.php</b>, line <b>242</b>]<div id="cakeErr582c5144a6bb9-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr582c5144a6bb9-code').style.display = (document.getElementById('cakeErr582c5144a6bb9-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);" onclick="document.getElementById('cakeErr582c5144a6bb9-context').style.display = (document.getElementById('cakeErr582c5144a6bb9-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="cakeErr582c5144a6bb9-code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color: #0000BB"> & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Events, v2.0.0 | |
Created by Anton Horodchuk for the ABillS Framework, http://abills.net.ua/ | |
MIT License | |
Simple JavaScript Event PubSub implementation | |
One can install listener for event with 'on' | |
events.on('eventhappened', function(data){ console.log(data) }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE dhcphosts_networks SET ip_range_last = INET_ATON(INET_NTOA(ip_range_first + (INET_ATON('255.255.255.255') - INET_ATON(INET_NTOA(mask))) - 2 )) |