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
| private String getDeviceClass(BluetoothDevice bluetoothDevice) { | |
| int devclass = bluetoothDevice.getBluetoothClass().getDeviceClass(); | |
| if (devclass == BluetoothClass.Device.Major.COMPUTER) { | |
| return "PC"; | |
| } else if (devclass == BluetoothClass.Device.Major.PHONE) { | |
| return "PHONE"; | |
| } else if (devclass == BluetoothClass.Device.Major.AUDIO_VIDEO) { | |
| return "AUDIO_VIDEO"; | |
| } else if (devclass == BluetoothClass.Device.Major.HEALTH) { | |
| return "HEALTH"; |
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
| declare -a SERVICES=( | |
| nginx | |
| mysql | |
| testservice | |
| ) | |
| for i in "${SERVICES[@]}"; do | |
| systemctl is-active --quiet "$i" && STATUS="active" || STATUS="notactive" | |
| if [ "${STATUS}" = "active" ]; then |
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
| public static void initHeadOverlay(Context c) { | |
| try { | |
| if (headoverlay_mHeadView != null) { | |
| headoverlay_mHeadView.setVisibility(View.GONE); | |
| headoverlay_mHeadView = null; | |
| } | |
| headoverlay_mHeadView = LayoutInflater.from(c).inflate(R.layout.head_layout, null); | |
| final WindowManager.LayoutParams params = new WindowManager.LayoutParams( | |
| WindowManager.LayoutParams.WRAP_CONTENT, | |
| WindowManager.LayoutParams.WRAP_CONTENT, |
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
| class DCConvert { | |
| private String retKey; | |
| private int len; | |
| private static boolean DEBUG = false; | |
| public DCConvert(String s) { | |
| char[] lock = s.toCharArray(); | |
| len = lock.length; | |
| char[] key = new char[len]; | |
| for (int i = 0; i < s.length(); i++) { |
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
| new Timer().scheduleAtFixedRate(new TimerTask() { | |
| @Override | |
| public void run() { | |
| method_call(); | |
| } | |
| }, 0, 10000); | |
| android.os.Handler handler = new android.os.Handler(); | |
| handler.postDelayed(new Runnable(){ | |
| public void run(){ |
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
| Bluetooth LOW ENERGY | |
| Optimized for: Short burst data transmission | |
| Frequency Band: 2.4GHz ISM Band (2.402 – 2.480 GHz Utilized) | |
| Channels: 40 channels with 2 MHz spacing (3 advertising channels/37 data channels) | |
| Channel Usage: Frequency-Hopping Spread Spectrum (FHSS) | |
| Modulation: GFSK | |
| Power Consumption: ~0.01x to 0.5x of reference (depending on use case) | |
| Data Rate: LE 2M PHY: 2 Mb/s LE 1M PHY: 1 Mb/s LE Coded PHY (S=2): 500 Kb/s LE Coded PHY (S=8): 125 Kb/s | |
| Max Tx Power: Class 1: 100 mW (+20 dBm) Class 1.5: 10 mW (+10 dbm) Class 2: 2.5 mW (+4 dBm) Class 3: 1 mW (0 dBm) |
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
| const char MAIN_page[] PROGMEM = R"=====( | |
| <html> | |
| <head> | |
| <title>SONT RELAY CONTROL PAGE</title> | |
| <style> | |
| @media only screen and (max-device-width: 480px) { | |
| //.zoom { zoom: 150%; position: fixed; } | |
| } | |
| small{ | |
| font-size: 16px; |
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
| tshark -T fields -e wlan.sa_resolved -e wlan.da._resolved -e wlan.sa -l -i wlan0 -o gui.column.format:'"MAC", "%uhs","RSSI", "%e"' | while read line; do echo "$line" >> mac.log; done | |
| # SZAR sudo tshark -S -l -i wlan0 -Y 'wlan.fc.type_subtype eq 4' -T fields -e wlan.sa -e wlan_mgt.ssid | |
| tshark -i wlan0 -Y http.request -T fields -e http.host -e http.request.full_uri | |
| tshark -i wlan0 -f "src port 53" -n -T fields -e frame.time -e ip.src -e ip.dst -e dns.qry.name | |
| tshark -i wlan0 -Y 'http.request.method == POST and tcp contains "password"' | grep password | |
| SELECT * FROM gps WHERE whattime > CURDATE(); |
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
| package sample; | |
| import java.text.DateFormat; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import java.util.TimeZone; | |
| public class TimeElapsedUtil { | |
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 | |
| CUR_DIR=$(pwd) | |
| counter=0 | |
| echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
| for i in $(find . -name ".git" | cut -c 3-); do | |
| echo ""; | |
| echo "\033[33m"+$i+"\033[0m"; | |
| counter=$((counter+1)) |