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
mkdir ~/android | |
mtp-detect | |
mtpfs ~/android | |
#to unmount | |
fusermount -u ~/android |
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
String jsonStr = "{ \"debug_info\" : [], \"html_attributions\" : [], \"results\" : [ { \"geometry\" : { \"location\" : { \"lat\" : 12.9774180, \"lng\" : 77.71423799999999 } }, \"icon\" : \"http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png\", \"id\" : \"742446507e37ea90df8389717e4835fe659183ed\", \"name\" : \"The Oriental Pavilion\", \"reference\" : \"CoQBdAAAAO8vSS9emj1nHgkl6zfX2RBC2HqMJEUPMFHH3HkCxwNy4Sa8Y9CynZo7sozZV5CPEDMvvg5GMFQBPxAdPX0oDMzOJhvqDq_wr2eWIlFKV7fB2Inm1GWj0hCMOsLy3zD8RVAMN74JIsHyR-xQWulDRwsxxQ-bhbmBzCYFfxTKd-I1EhDBAkzm4xIWEEIdmWriBsgyGhStZUB2SzvEb2j6nuuzjsMxHHzNzg\", \"types\" : [ \"restaurant\", \"food\", \"establishment\" ], \"vicinity\" : \"134-136, Fortune Select Trinity, ITPL Main Road, EPIP Area, Whitefield, Bangalore\" }, { \"geometry\" : { \"location\" : { \"la |
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 | |
cd ~/backups | |
folder=$(date +%Y%m%d) | |
mkdir $folder && cd $folder | |
mongodump -d sharurl | |
tar -cvf dump.tar.gz ./dump | |
rm -rf ./dump |
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 | |
cd ~/backups | |
folder=$(date +%Y%m%d) | |
mkdir $folder && cd $folder | |
mongodump -d sharurl | |
tar -cvf dump.tar.gz ./dump | |
rm -rf ./dump |
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 request, make_response, | |
def any_response(data): | |
ALLOWED = ['http://localhost:8888'] | |
response = make_response(data) | |
origin = request.headers['Origin'] | |
if origin in ALLOWED: | |
response.headers['Access-Control-Allow-Origin'] = origin | |
return response |
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 datetime | |
import time | |
# some datetime object | |
dt = datetime.datetime.now() | |
# get the seconds since epoch for that datetime | |
print time.mktime(dt.timetuple()) |
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
* text=auto | |
* text eol=crlf | |
*.html text eol=crlf | |
*.css text eol=crlf | |
*.js text eol=crlf | |
*.json text eol=crlf |
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
adb reboot bootloader | |
fastboot flash bootloader bootloader-hammerhead-HHZ11d.img | |
fastboot reboot-bootloader | |
fastboot flash radio radio-hammerhead-M8974A-1.0.25.0.17.img | |
fastboot reboot-bootloader | |
fastboot -w update image-hammerhead-krt16m.zip | |
fastboot reboot-bootloader |
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 | |
cd ${1} | |
for f in `find .*rc`; do | |
echo $f | |
tr -d '\15\32' < $f > $f.tr | |
mv $f.tr $f | |
done |
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
# Solving unicode to ascii conversion error | |
str1 = '\xc6\xe5\t\xc5\xba\xc6;\xe4y\xdf8\xd8U\xcb\xff\xaaT@\r&\x8c\xbd\x95v' | |
print type(str1) | |
str_in_ascii = str1.encode('base-64') | |
print type(str_in_ascii) |
OlderNewer