Skip to content

Instantly share code, notes, and snippets.

Avatar

Mando Stam madlymad

View GitHub Profile
@madlymad
madlymad / proxy_config.sh
Last active Oct 7, 2020
MacOS script for loading system proxy setting at bash and git
View proxy_config.sh
#!/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
@madlymad
madlymad / ipa-uploader
Created Mar 22, 2019 — forked from beny/ipa-uploader
validate and check ipa to iTunes Connect
View ipa-uploader
#!/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
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;
@madlymad
madlymad / CNTLM Proxy - Centos
Created Sep 26, 2018 — forked from lpf23/CNTLM Proxy - Centos
Configure CNTLM Proxy on Centos/Ubuntu
View CNTLM Proxy - Centos
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>
@madlymad
madlymad / AndroidManifest.xml
Last active Mar 20, 2018 — forked from alexsinger/build.gradle
Separate Crashlytics reporting for debug and release buildTypes using a Gradle build
View AndroidManifest.xml
<?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}" />
@madlymad
madlymad / route_wifi.sh
Last active Nov 3, 2017 — forked from cpthooch/route_wifi.sh
Routing all traffic to particular IP address via wifi network interface on MacOS
View route_wifi.sh
#!/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:]]}`
@madlymad
madlymad / book_swf_to_png.sh
Created Mar 25, 2017
download swf pages of a book and convert to png files
View book_swf_to_png.sh
#!/bin/bash
# Add the number of pages
pages=$((134))
rm -rf *.swf*
mkdir SWF
mkdir PNG
You can’t perform that action at this time.