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
2017/6/15, 18:51:59, 1, 0, 0, 0, 0.21, 22.04, 43.97, 64.19, 26.62, | |
2017/6/15, 18:52:0, 2, 12, 28, 30, 0.21, 16.79, 43.97, 64.25, 26.59, | |
2017/6/15, 18:52:0, 3, 12, 28, 30, 0.21, 18.44, 43.97, 64.31, 26.62, | |
2017/6/15, 18:52:1, 4, 11, 28, 31, 0.21, 18.44, 43.97, 64.37, 26.59, | |
2017/6/15, 18:52:2, 5, 11, 28, 31, 0.21, 20.19, 43.97, 64.37, 26.66, | |
2017/6/15, 18:52:2, 6, 11, 28, 31, 0.21, 18.44, 43.97, 64.37, 26.59, | |
2017/6/15, 18:52:3, 7, 13, 28, 31, 0.21, 18.44, 43.97, 64.31, 26.62, | |
2017/6/15, 18:52:4, 8, 13, 28, 31, 0.21, 20.19, 43.97, 64.31, 26.59, | |
2017/6/15, 18:52:4, 9, 13, 28, 31, 0.21, 20.19, 43.97, 64.31, 26.62, | |
2017/6/15, 18:52:5, 10, 13, 28, 31, 0.21, 18.44, 43.75, 64.25, 26.62, |
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
# Get the MAC id of the interface | |
MAC=`cat /sys/class/net/wlan0/address` | |
# Print the MAC ID without colon | |
echo "$MAC" | tr -d : |
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
heroku pg:reset DATABASE_URL | |
heroku run python manage.py makemigrations | |
heroku run python manage.py migrate |
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
# Create-AP (Link : https://github.com/oblique/create_ap) | |
/usr/bin/DisarmBootScript | |
------------------------- | |
#!/bin/bash | |
/home/alarm/create_ap/create_ap -g 192.168.43.1 wlan0 eth0 DisarmHotspotDB | |
etc/systemd/system/DisarmBootScript.service | |
-------------------------------------------- | |
[Unit] | |
Description=DisarmBootScript |
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 sys | |
import os | |
# Get list of all users present in the system | |
allUsers = os.popen('cut -d: -f1 /etc/passwd').read().split('\n')[:-1] | |
for users in allUsers: | |
# Check if the home directory exists for the user | |
if os.path.exists('/home/' + str(users)): | |
# Print the current usage of the user |
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 re | |
def YTDurationToSeconds(duration): | |
match = re.match('PT(\d+H)?(\d+M)?(\d+S)?', duration).groups() | |
hours = _js_parseInt(match[0]) if match[0] else 0 | |
minutes = _js_parseInt(match[1]) if match[1] else 0 | |
seconds = _js_parseInt(match[2]) if match[2] else 0 | |
return hours * 3600 + minutes * 60 + seconds | |
# js-like parseInt |