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
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git pull" \; |
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
//1ms but uses file cache so not updated quickly | |
try { | |
String inputLine; | |
FileReader file = new FileReader("/sys/class/power_supply/battery/current_now"); | |
BufferedReader bufferedReader = new BufferedReader(file); | |
inputLine = bufferedReader.readLine(); | |
text = inputLine; | |
bufferedReader.close(); | |
file.close(); | |
} catch (Exception 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
From AOSP page: | |
"Analyzing app startup time | |
Use $ adb shell am start with the -P or --start-profiler option to run the profiler when your app starts. | |
This will start the profiler almost immediately after your process is forked from zygote, before any of your code is loaded into it." |
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
In Android Manifest file declare following | |
<application android:name="com.xyz.MyApplication"> | |
</application> | |
then write the class | |
public class MyApplication extends Application{ | |
private static Context context; |
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 twisted.web import server, resource | |
from twisted.internet import reactor, endpoints | |
class Counter(resource.Resource): | |
isLeaf = True | |
numberRequests = 0 | |
def render_GET(self, request): | |
self.numberRequests += 1 | |
request.setHeader("content-type", "text/plain") |
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
http://www.unspecific.com/nmap/ | |
vi nmap-wrapper.pl --> add $opt_d=3 | |
$ sudo ./bin/nmap-wrapper.pl -v -l 10.0.0.0/24 | |
$ nmap-search.pl -f ./20150320.10.0.0.gnmap port 80 | |
$ nmap-report.pl -p80 -v | |
#html output | |
#nmap has a built in xslt stylsheet in xml output, convert to html |
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
#nmap host discovery | |
#Nmap sends an ICMP echo request, a TCP SYN packet to port 443, a TCP ACK packet to port 80, and an ICMP timestamp request. | |
$ time sudo zmap -p 80 -i wlan1 10.0.0.0/24 | |
real 0m9.135s | |
user 0m0.153s | |
sys 0m0.109s | |
CIDR 24 |
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 install mesa-utils | |
glxinfo | grep OpenGL | |
optirun | grep OpenGL | |
glxsheres64 | |
optirun -vv glxspheres64 | |
lspci | grep NVIDIA | |
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 shell dumpsys procstats --hours 3 | |
adb shell dumpsys meminfo | |
adb shell dumpsys activity | |
#get com.android content providers | |
adb shell dumpsys | grep Provider{ | grep com.android | |
#call logs | |
adb shell content query --uri content://call_log/calls |