-
Define proxy in
.gitconfig
( You can find it by run this command :git config --list --global --show-origin
)[http] proxy = http://username:password@proxydomain:port sslverify = false [https] proxy = http://username:password@proxydomain:port sslverify = false
-
Use environment variable
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
# see How to Install Redis Server on CentOS 7 - http://linoxide.com/storage/install-redis-server-centos-7/ | |
# --- Compiling --- | |
$ yum install gcc make tcl | |
$ REDIS_VER=3.2.3 | |
$ wget http://download.redis.io/releases/redis-$REDIS_VER.tar.gz | |
$ tar xzvf redis-$REDIS_VER.tar.gz | |
$ cd redis-$REDIS_VER | |
$ make | |
$ make test |
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
static void uploadFile(Context context, final String selectedFilePath) { | |
int serverResponseCode = 0; | |
HttpURLConnection connection; | |
DataOutputStream dataOutputStream; | |
String lineEnd = "\r\n"; | |
String twoHyphens = "--"; | |
String boundary = "*****"; | |
int bytesRead, bytesAvailable, bufferSize; | |
byte[] buffer; |
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
public static boolean isValidEmail(String target) { | |
boolean check1 = Patterns.EMAIL_ADDRESS.matcher(target).matches(); | |
Pattern pattern; | |
Matcher matcher; | |
String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; | |
pattern = Pattern.compile(EMAIL_PATTERN); | |
matcher = pattern.matcher(target); | |
boolean check2 = matcher.matches(); | |
return target.isEmpty() || check1 && check2; | |
} |
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
@SuppressWarnings("deprecation") | |
@SuppressLint("HardwareIds") | |
public static HashMap<String, String> GenerateDeviceInformation(Context context) { | |
HashMap<String, String> result = new HashMap<>(); | |
String pseudoId = "35" + | |
Build.BOARD.length() % 10 + | |
Build.BRAND.length() % 10 + | |
Build.CPU_ABI.length() % 10 + | |
Build.DEVICE.length() % 10 + | |
Build.DISPLAY.length() % 10 + |
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
public static void hideStatusbar(Activity context) { | |
if (Build.VERSION.SDK_INT < 16) { | |
context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} else { | |
View decorView = context.getWindow().getDecorView(); | |
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; | |
decorView.setSystemUiVisibility(uiOptions); | |
} | |
} |
- MDPI : 75x32
- HDPI : 112x48
- XHDPI : 149x64
- XXHDPI : 225x96
- XXXHDPI : 300x128
- CSR / Private / buy
cat SHA-2.crt Certum_Domain_Validation_CA_SHA2.crt Certum_Trusted_Network_CA.crt mine > bundle.crt
- copy certs to /usr/local/share/ca-certificates
sudo update-ca-certificates
reboot
- config nginx / reload
- check using :
openssl s_client -connect domain:443 -CApath /etc/ssl/certs
- buy
- make CSR / Private
cat SHA-2.crt Certum_Domain_Validation_CA_SHA2.crt Certum_Trusted_Network_CA.crt mine > bundle.crt
- copy certs to /usr/local/share/ca-certificates
sudo update-ca-certificates
reboot
- config nginx / reload
- check using :
openssl s_client -connect domain:443 -CApath /etc/ssl/certs
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
server { | |
listen 80; | |
server_name mysite.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { | |
listen 443; | |
... | |
... |