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
sudo apt-get update | |
sudo apt-get install apache2 | |
sudo apache2ctl configtest | |
sudo ufw app list | |
sudo ufw app info "Apache Full" | |
sudo ufw allow in "Apache Full" | |
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' | |
sudo apt-get install curl | |
sudo apt-get install mysql-server | |
#sudo mysql_secure_installation |
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 | |
#on displays the actual folder name | |
echo "the folder is 'pwd'" | |
#then the rest of the files | |
echo "The folder which contains files are 'ls'" |
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
//setup | |
$.ajaxSetup({ | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); | |
// Actual ajax | |
$.post(submittarget,{data:data},function(e){ | |
console.log(e); | |
}); |
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 eatiht | |
url = raw_input() | |
print eatiht.extract(url) |
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
function parseTime(t1){ | |
t3=t1.split(" ")[1]=='pm'?(parseInt(t1.split(" ")[0].split(":")[0])*60+parseInt(t1.split(" ")[0].split(":")[1])+720):parseInt(t1.split(" ")[0].split(":")[0]*60)+parseInt(t1.split(" ")[0].split(":")[1]) | |
return t3 | |
} | |
function compare(t1,t2){ | |
console.log(parseTime(t1)) |
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 flask import Flask,render_template,jsonify,Response,json,url_for,request | |
import os | |
app = Flask(__name__) | |
UPLOAD_FOLDER=os.path.basename("uploads") | |
ALLOWED_EXTENSIONS = set(['csv']) | |
app.config['UPLOAD_FOLDER']=UPLOAD_FOLDER | |
def allowed_file(filename): |
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
license: mit |
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
function uuidv4() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
uuid_track=0 | |
if (document.cookie.indexOf("uuid_set=")==-1){ | |
uuid_track = uuidv4() | |
document.cookie = "uuid_set="+ uuid_track |
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
function uuidv4() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
uuid_track=0 | |
if (document.cookie.indexOf("uuid_set=")==-1){ | |
uuid_track = uuidv4() | |
document.cookie = "uuid_set="+ uuid_track |
OlderNewer