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
| server { | |
| listen 80 default_server; | |
| server_name example.com www.example.com; | |
| access_log /srv/www/example.com/logs/access.log; | |
| error_log /srv/www/example.com/logs/error.log; | |
| root /srv/www/example.com/public; | |
| index index.php index.html; |
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
| # Compile nginx standalone without root access | |
| mkdir ~/installed | |
| mkdir ~/installed/nginx | |
| mkdir ~/src | |
| cd ~/src | |
| # PCRE dependency - we'll compile against this statically | |
| wget http://kent.dl.sourceforge.net/sourceforge/pcre/pcre-7.8.tar.gz | |
| tar -xzvf pcre-7.8.tar.gz |
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 void addAutoStartupswitch() { | |
| try { | |
| Intent intent = new Intent(); | |
| String manufacturer = android.os.Build.MANUFACTURER .toLowerCase(); | |
| String model= Build.MODEL; | |
| Log.d("DeviceModel",model.toString()); | |
| switch (manufacturer){ | |
| case "xiaomi": |
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
| web: node web.js | |
| worker: node worker.js | |
| clock: node clock.js |
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
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| try { | |
| Log.d(TAG, "onCreate: INSTALLED GOOGLE PLAY VERSION: " | |
| + getPackageManager() | |
| .getPackageInfo("com.google.android.gms", 0).versionName); | |
| } catch (PackageManager.NameNotFoundException e) { |
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
| https://www.geoplugin.com/quickstart |
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
| [ | |
| { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
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
| { | |
| "USD": { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
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
| #user nobody; | |
| worker_processes 1; | |
| #error_log logs/error.log; | |
| #error_log logs/error.log notice; | |
| #error_log logs/error.log info; | |
| #pid logs/nginx.pid; | |
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 byte[] hexStringToByteArray(String s) { | |
| int len = s.length(); | |
| byte[] data = new byte[len / 2]; | |
| for (int i = 0; i < len; i += 2) { | |
| data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) | |
| + Character.digit(s.charAt(i + 1), 16)); | |
| } | |
| return data; | |
| } | |
| // Ref: https://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java/140861#140861 |