Skip to content

Instantly share code, notes, and snippets.

momoterraw andrewvmail

  • Vancouver
Block or report user

Report or block andrewvmail

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View shell-exports
export first_container_id=$(docker ps | head -2 | awk '{print $1}' | tail -1)
@andrewvmail
andrewvmail / build.gradle
Created Jul 3, 2019 — forked from tprochazka/build.gradle
Smart versionName and versionCode for android Gradle build evaluation
View build.gradle
/**
* Will return version from properties file and replace -SNAPSHOT by GIT commit hash
* to recognize origin commit for the every build.
*/
project.ext.evalVersionName = {
def ideBuild = project.properties['android.injected.invoked.from.ide']
if (ideBuild) {
logger.info("IDE build");
return "dev"
} else if (project.VERSION.toUpperCase().contains("SNAPSHOT")) {
@andrewvmail
andrewvmail / interval.js
Created Jun 26, 2019 — forked from manast/interval.js
Accurate Javascript setInterval replacement
View interval.js
function interval(duration, fn){
this.baseline = undefined
this.run = function(){
if(this.baseline === undefined){
this.baseline = new Date().getTime()
}
fn()
var end = new Date().getTime()
this.baseline += duration
@andrewvmail
andrewvmail / combining-git-repositories.md
Created Jun 26, 2019 — forked from msrose/combining-git-repositories.md
How to combine two git repositories.
View combining-git-repositories.md

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@andrewvmail
andrewvmail / 00-about-search-api-examples.md
Created Jun 13, 2019 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
View 00-about-search-api-examples.md
@andrewvmail
andrewvmail / mysql_secure.sh
Last active May 21, 2019 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
View mysql_secure.sh
#!/bin/bash
set -x
SECURE_MYSQL=$(expect -c "
set timeout 10
spawn mysql_secure_installation
expect \"Would you like to setup VALIDATE PASSWORD plugin?\"
send \"n\r\"
expect \"New password:\"
@andrewvmail
andrewvmail / tsung.xml
Created May 11, 2019
tsung.xml test plain non websocket xmppp
View tsung.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/home/blah/tsung/tsung-1.0.dtd" []>
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true"></client>
</clients>
<!-- Server side setup -->
<servers>
<server host="localhost" port="5280" type="websocket"></server>
</servers>
@andrewvmail
andrewvmail / tsung.xml
Created May 11, 2019
tsung.xml test plain non websocket xmppp
View tsung.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/home/blah/tsung/tsung-1.0.dtd" []>
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true"></client>
</clients>
<!-- Server side setup -->
<servers>
<server host="localhost" port="5280" type="websocket"></server>
</servers>
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewvmail on github.
  • I am momoterraw (https://keybase.io/momoterraw) on keybase.
  • I have a public key ASBo9UdEpvKGz6QVCKlW0g2JCACBi0dmVWHx4pKLOr1sIgo

To claim this, I am signing this object:

View freeswitch.log
1/24/2019 6:03:48 PM ------------------------------------------------------------------------
1/24/2019 6:07:35 PMrecv 2974 bytes from udp/[104.131.141.200]:5040 at 02:07:35.050159:
1/24/2019 6:07:35 PM ------------------------------------------------------------------------
1/24/2019 6:07:35 PM INVITE sip:drachtio@104.131.141.200:5080 SIP/2.0
1/24/2019 6:07:35 PM Via: SIP/2.0/UDP 104.131.141.200:5040;rport;branch=z9hG4bKrUyBKFpSgZc8j
1/24/2019 6:07:35 PM Max-Forwards: 70
1/24/2019 6:07:35 PM From: <sip:104.131.141.200:5040>;tag=2g5XB1Kgr8H0e
1/24/2019 6:07:35 PM To: <sip:drachtio@104.131.141.200:5080>
1/24/2019 6:07:35 PM Call-ID: d28cf4dd-9ae8-1237-3fb3-623ecdc6df55
1/24/2019 6:07:35 PM CSeq: 133854963 INVITE
You can’t perform that action at this time.