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
var autobahn = require('autobahn'); | |
var connection = new autobahn.Connection({url: 'ws://127.0.0.1:8080/ws', realm: 'realm1'}); | |
connection.onopen = function (session) { | |
console.log("opened " + session); | |
// 4) call a remote procedure | |
session.call('com.math.slowsquare', [3]).then( | |
function (res) { | |
console.log("SlowSquare: ", res); |
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
const w3cws = require('websocket').w3cwebsocket; | |
const wampy = require('wampy'); | |
const ws = new wampy.Wampy('ws://127.0.0.1:8080/ws', { autoReconnect: false, ws: w3cws, realm: 'realm1' }); | |
//exports.ws = ws; | |
//const wampy = require('./wampy_client.js'); | |
//const ws = wampy.ws; | |
console.log('start'); |
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
apt-get download $(apt-rdepends $1|grep -v "^ " |grep -v "^libc-dev$" | sed 's/debconf-2.0/debconf/g') |
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
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |
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/bashn | |
if [ -z "$1" ]; then | |
echo "sudo yumdown.sh [packageName]" | |
exit 1 | |
fi | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root (sudo yumdown.sh [packageName])" | |
exit |
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
FOR /F "delims=~" %f in (requirements.txt) DO conda install --yes "%f" || pip install "%f" | |
while read requirement; do conda install --yes $requirement || pip install $requirement; done < requirements.txt |
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
#One workaround is to create clone environment, and then remove original one: | |
#(remember about deactivating current environment with deactivate on Windows and source deactivate on macOS/Linux) | |
conda create --name new_name --clone old_name --offline #use --offline flag to disable the redownload of all your packages | |
conda remove --name old_name --all # or its alias: `conda env remove --name old_name` | |
#There are several drawbacks of this method: | |
# time consumed on copying environment's files, | |
# temporary double disk usage. |
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
if pgrep nexusd &> /dev/null; then | |
echo nexusd process already exists | |
else | |
nohup go/bin/nexusd -c go/etc/nexus.json 1>~/nexusd.log 2>&1 & | |
fi |
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
[requirements.txt] | |
while read requirement; conda install --yes $requirement;or pip install $requirement; end < requirements.txt |
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
# https://unix.stackexchange.com/a/10043 | |
# List files later than 1 day diff | |
find . -maxdepth 1 -mtime -1 | |
# List files older than 1 day diff | |
find . -maxdepth 1 -mtime +1 |