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
from django.contrib.auth.decorators import login_required | |
from django.conf import settings | |
from re import compile | |
from django.http import HttpRequest, HttpResponse | |
from core.models import ActivityLog | |
from core.utils import get_ip_address | |
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
#!/bin/bash | |
while true | |
do | |
echo "checking connection" | |
if [ -n "$(nmcli -p d | grep cdma)" ]; then | |
echo "modem is connected" | |
if ! [ "$(ping -c 1 -W 30 google.com)" ]; then | |
nmcli nm wwan off | |
nmcli nm wwan on | |
# nmcli con up id "evdo" |
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
def flatten_array(array): | |
""" | |
flattens multi-dimensional array/list to one dimensional | |
Args: | |
array (list): multi-dimensional list | |
Returns: | |
list: resultant one-dimensional list | |
>>> flatten_array([1, 2, 3, 4, [7, 8, 9]]) |
NewerOlder