View BaseTest.kt
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
abstract class BaseTest { | |
@OptIn(ExperimentalCoroutinesApi::class) | |
@get:Rule | |
var coroutinesTestRule = CoroutinesTestRule() | |
@get:Rule | |
var instantTaskExecutorRule = InstantTaskExecutorRule() | |
lateinit var application: Application |
View proxy_config.sh
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
#!/bin/bash | |
proxyToFile() { | |
local filename="$2" | |
# break if filename not found | |
if [[ ! -f $filename ]]; then return -1; fi | |
local add="$1" | |
if [[ "$add" = "true" ]]; then | |
perl -pi -e 's/^#http/http/' $filename |
View ipa-uploader
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
#!/bin/bash | |
# origin https://gist.github.com/keith/5b5f61f4cc690aec403afd92aab020c3 | |
altool="$(dirname "$(xcode-select -p)")/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool" | |
appleId="apple-id@example.com" | |
echo "Validating app..." | |
time "$altool" --validate-app --file "$1" --username "$appleId" --password @keychain:"Application Loader: $appleId" | |
echo "Uploading app to iTC..." | |
time "$altool" --upload-app --file "$1" --username "$appleId" --password @keychain:"Application Loader: $appleId" |
View EmptyRecyclerView.java
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
package com.alexzh.recyclerviewsetemptyview; | |
import android.content.Context; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
public class EmptyRecyclerView extends RecyclerView { | |
private View mEmptyView; |
View CNTLM Proxy - Centos
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
1) Download cntlm rpm package from http://sourceforge.net/projects/cntlm/files/cntlm/ | |
2) Login as root | |
3) Run command: | |
$ rpm -ivh cntlm-*.rpm | |
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration) | |
$ cntlm -H -d <domain> -u <username> |
View AndroidManifest.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="your.package.name"> | |
<!-- Your code here--> | |
<meta-data | |
android:name="io.fabric.ApiKey" | |
android:value="${crashlyticsApiKey}" /> |
View route_wifi.sh
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
#!/bin/bash | |
# NOTE: wifi/ethernet network interface is: en1 | |
net_interface=en1 | |
mac_network_interface=ifconfig $net_interface ether | sed -nl 's/\w*ether \([^ ]*\).*/\1/p' | sed 's/:/./g' | |
wifi_router=netstat -nr | grep default | grep $net_interface | perl -nle '/(\d+\.\d+\.\d+\.\d+)/ && print $1' | |
wifi_address=$net_interface:$mac_network_interface | |
TOADDR=`ifconfig $net_interface inet | sed -nl 's/\w*inet \([^ ]*\).*/\1/p'` | |
TO=`echo -n ${TOADDR//[[:space:]]}` |
View book_swf_to_png.sh
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
#!/bin/bash | |
# Add the number of pages | |
pages=$((134)) | |
rm -rf *.swf* | |
mkdir SWF | |
mkdir PNG |