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
Disclaimer: The instructions are the collective efforts from a few places online. | |
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did. | |
First off, bundle. | |
================== | |
1. cd to the project directory | |
2. Start the react-native packager if not started | |
3. Download the bundle to the asset folder: | |
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" |
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
import sys, json, numpy as np | |
#Read data from stdin | |
def read_in(): | |
lines = sys.stdin.readlines() | |
#Since our input would only be having one line, parse our JSON data from that | |
return json.loads(lines[0]) | |
def main(): | |
#get our data as an array from read_in() |
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
cat file.xml | sed -e "s/<\([^>]*\) \/>/<\1><\/\1>/g" > newfile.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
function threeArraySort(ipList, macList, srttList) { | |
var list = []; | |
for (var j in ipList) | |
list.push({'ip': ipList[j], 'mac': macList[j], 'srtt': srttList[j] }); | |
list.sort(function(a, b) { | |
return ((a.srtt < b.srtt) ? -1 : ((a.srtt == b.srtt) ? 0 : 1)); | |
}); | |
for (var k = 0; k < list.length; k++) { |
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
Found Xcode project YourAwesomeProject.xcodeproj | |
Launching iPhone 6 (10.0)... | |
Building using "xcodebuild -project YourAwesomeProject.xcodeproj -scheme YourAwesomeProject -destination id=2DE46585-1211-49CB-B5E2-AC3AF7777C3C -derivedDataPath build" | |
User defaults from command line: | |
IDEDerivedDataPathOverride = /Users/jkomyno/dev/YourAwesomeProject/ios/build | |
=== BUILD TARGET RCTLinking OF PROJECT RCTLinking WITH CONFIGURATION Debug === | |
Check dependencies |
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 | |
cd /data/tools/ | |
wget http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2 | |
bzip2 -cd wmi-1.3.14.tar.bz2 | tar xf - | |
cd wmi-1.3.14/ | |
sudo make "CPP=gcc -E -ffreestanding" | |
sudo cp Samba/source/bin/wmic /usr/local/bin/ |
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
Summary: | |
Support for GTK+ frontends: no (install gtk,gconf) | |
Support for SSL in SWAT and LDAP: no (install GNUTLS) | |
Support for threads in smbd (see --with-pthread): no (install PTHREAD) | |
Support for intelligent command line editing: no (install READLINE) | |
Support for changing process titles (see --with-setproctitle): no (install SETPROCTITLE) | |
Support for using extended attributes: yes | |
Support for using libblkid: no (install BLKID) | |
Support for using iconv: yes |
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
String.prototype.replaceAll = function(search, replacement) { | |
return this.split(search).join(replacement) | |
}; | |
export function doesNetworkAlreadyExist(singleNetwork, globalNetworksRange) { | |
let arr = globalNetworksRange.map(network => network.ip); | |
let str = arr.join(","); | |
return str.indexOf(singleNetwork) !== -1 | |
} |
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
class BaseComponent extends React.Component { | |
_bind(...methods) { | |
methods.forEach( (method) => this[method] = this[method].bind(this) ); | |
} | |
} | |
class ExampleComponent extends BaseComponent { | |
constructor() { | |
super(); | |
this._bind('_handleClick', '_handleFoo'); |
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
// Convert a struct sockaddr address to a string, IPv4 and IPv6: | |
char *get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen) | |
{ | |
switch(sa->sa_family) { | |
case AF_INET: | |
inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr), | |
s, maxlen); | |
break; |
OlderNewer