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 android.util.Log; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
private void executeCommand() { | |
String inputLine; | |
String output = ""; | |
Process process = Runtime.getRuntime().exec("cat /proc/net/xt_qtaguid/stats"); | |
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())); | |
while ((inputLine = in.readLine()) != null) { |
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 android.net.TrafficStats; | |
import android.app.ActivityManager; | |
import android.content.pm.PackageManager; | |
private void getServiceTraffic() { | |
PackageManager pm = getPackageManager(); | |
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); | |
List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(Integer.MAX_VALUE); | |
for (ActivityManager.RunningServiceInfo service : runningServices) { |
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 android.util.Log; | |
import java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
private void sendHTTPRequest() { |
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 android.os.Handler; | |
import android.os.Looper; | |
import android.os.Message; | |
import android.view.View; | |
import android.widget.TextView; | |
public void startWorker(View v) { | |
mThread.start(); | |
} |
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
function sendHTTP | |
{ | |
param( $uri, $message ) | |
$postData = "{" | |
$postData += "`"message`":`""+$message+"`"," | |
$postData += "`"name`":`"ryan`"" | |
$postData += "}" | |
$request = [System.Net.WebRequest]::Create($uri) | |
$request.Method = "POST" | |
$request.Timeout = 5000 |
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://askubuntu.com/questions/75852/how-do-i-see-which-ports-are-open | |
netstat -ntlp | grep LISTEN |
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
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
# @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ | |
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
# IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! | |
# Someone could be eavesdropping on you right now (man-in-the-middle attack)! | |
# It is also possible that a host key has just been changed. | |
# The fingerprint for the RSA key sent by the remote host is | |
# f0:6f:50:f0:13:96:32:67:99:79:14:59:b6:32:16:16. | |
# Please contact your system administrator. | |
# Add correct host key in /Users/ryan/.ssh/known_hosts to get rid of this message. |
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
# Ubuntu box with 2 NICs | |
# eth0 = WAN | |
# eth1 = LAN | |
# OR | |
# eth0 = larger network | |
# eth1 = smaller network | |
# Setup and install | |
sudo apt-get install iptables-persistent |
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
frontend rdp | |
mode tcp | |
bind 192.168.1.11:3389 | |
tcp-request inspect-delay 2s | |
tcp-request content accept if RDP_COOKIE | |
acl userID_a19281 rdp_cookie(mstshash) -i user123 | |
use_backend backend_a19281 if userID_a19281 | |
acl userID_8721bc rdp_cookie(mstshash) -i user456 |
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
# Works fine on ubuntu 14.04. Gave me issues on 16.04. | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo add-apt-repository ppa:vbernat/haproxy-1.6 | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install haproxy -y | |
# Edit the haproxy config | |
sudo nano /etc/haproxy/haproxy.cfg |
OlderNewer