This file contains hidden or 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
http://www.hackerparadise.org/raffle/?ks_giveaway=win-2-years-worth-of-free-coworking-around-the-world&lucky=3034 |
This file contains hidden or 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
search expensive urls in a uwsgi server log. | |
hits between 3 and 99 seconds: | |
python check.py uwsgi.log 3000 99999 | |
output: | |
GET /api/1/search?q=E => generated 470381 bytes in 3433 msecs (HTTP/1.0 200) 4 headers in 135 bytes (1 switches on core 0) | |
GET /api/1/search?q=A => generated 586983 bytes in 4412 msecs (HTTP/1.0 200) 4 headers in 135 bytes (1 switches on core 0) | |
GET /api/1/search?q=R => generated 457041 bytes in 3653 msecs (HTTP/1.0 200) 4 headers in 135 bytes (1 switches on core 0) |
This file contains hidden or 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
[ | |
{ | |
"pk": 1, | |
"model": "countries.country", | |
"fields": { | |
"languages": "ca", | |
"code3": "AND", | |
"name": "Andorra", | |
"capital": "Andorra la Vella", | |
"country_id": 3041565, |
This file contains hidden or 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 os | |
from shutil import copy2, copyfile | |
origin = "/Users/panchicore/Dropbox (Personal)/PSDs AQHJ 2.0/Android/assets/assets/res" | |
destination = "/Users/panchicore/AndroidStudioProjects/Aquehorajuega/app/src/main/res" | |
folders = ["drawable-hdpi", "drawable-mdpi", "drawable-xhdpi", "drawable-xxhdpi"] | |
filename = raw_input("filename in this dir: ") | |
for folder in folders: | |
_from = os.path.join(origin, folder, filename) | |
_to = os.path.join(destination, folder, filename) |
This file contains hidden or 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
@login_required | |
def change_password(request): | |
if request.method == 'POST': | |
form = PasswordChangeForm(request.user, data=request.POST) | |
if form.is_valid(): | |
form.save() | |
update_session_auth_hash(request, form.user) # dont logout the user. | |
messages.success(request, "Password changed.") | |
return redirect("/") | |
else: |
This file contains hidden or 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
66.249.73.192 - - [30/Oct/2015:18:48:12 -0500] "GET /media/thumbs/uploads/equipos/river-plate.png.50x50_q10.png HTTP/1.1" 404 144 "-" "Googlebot-Image/1.0" |
This file contains hidden or 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
10. blank activity | |
20. hello world | |
change hello world | |
saludations | |
30. menu | |
create menu layout | |
override onCreateOptionsMenu y onOptionsItemSelected | |
40. open activity con Intent | |
50. application class | |
60. models |
This file contains hidden or 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 base64 | |
import requests | |
url = "http://foo.bar" | |
users = ["", "admin", "root"] | |
for u in users: | |
for uu in users: | |
login = '{0}:{1}'.format(u, uu) | |
h = {"Authorization": "Basic {0}".format( base64.b64encode(login) )} |
This file contains hidden or 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 | |
sleep 20 && cd /home/ubuntu/www/aquehorajuega.co/aquehorajuega && /usr/bin/git pull origin master && sudo supervisorctl restart aqhj |
This file contains hidden or 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
<option value="Pacific/Midway">(GMT-11:00) Midway Island, Samoa</option> | |
<option value="America/Adak">(GMT-10:00) Hawaii-Aleutian</option> | |
<option value="Etc/GMT+10">(GMT-10:00) Hawaii</option> | |
<option value="Pacific/Marquesas">(GMT-09:30) Marquesas Islands</option> | |
<option value="Pacific/Gambier">(GMT-09:00) Gambier Islands</option> | |
<option value="America/Anchorage">(GMT-09:00) Alaska</option> | |
<option value="America/Ensenada">(GMT-08:00) Tijuana, Baja California</option> | |
<option value="Etc/GMT+8">(GMT-08:00) Pitcairn Islands</option> |