cpu-count.js:
console.log(require('os').cpus().length);
To compile:
gcc -shared -fPIC intercept.c -o intercept.so -ldl
const net = require('net'); | |
const { Client } = require('ssh2'); | |
function tunnel(localPort) { | |
const sshClient = new Client(); | |
let resolvePromise = null; | |
let rejectPromise = null; | |
const resultPromise = new Promise((resolve, reject) => { | |
resolvePromise = resolve; | |
rejectPromise = reject; |
import React from 'react'; | |
import { render, W } from '@wix/react-velo'; | |
function App() { | |
const [counter, setCounter] = React.useState(0); | |
return <> | |
<W.counter text={`Count: ${counter}`} /> | |
<W.increment label="+Increment" onClick={() => setCounter(counter+1)} /> | |
<W.decrement label="-Decrement" onClick={() => setCounter(counter-1)} /> | |
</> |
cpu-count.js:
console.log(require('os').cpus().length);
To compile:
gcc -shared -fPIC intercept.c -o intercept.so -ldl
'use strict'; | |
const { Writable } = require('stream'); | |
const PerMessageDeflate = require('./permessage-deflate'); | |
const { | |
BINARY_TYPES, | |
EMPTY_BUFFER, | |
kStatusCode, | |
kWebSocket |
# Unblock-File .\download.ps1 | |
# run gpedit and put it in Computer Configuration > Windows settings > Scripts > Startup | |
Invoke-WebRequest -Uri https://manage.wix.com/lambdaless-files-server/api/statics/agent/index.js -OutFile c:\agent.js | |
Start-Process -NoNewWindow node c:\agent.js |
// gcc curl.c -lcurl | |
#include <stdio.h> | |
#include <curl/curl.h> | |
// returns: | |
// 0 - file does not exists | |
// 1 - file exists | |
// -1 - failure | |
int is_remote_file_exists(const char* url) { | |
CURL *curl = curl_easy_init(); |
gcc -shared -fPIC inject_tcp.c -o inject.so -ldl
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <libproc.h> | |
int main (int argc, char* argv[]) | |
{ | |
int ret; | |
pid_t pid; |
#!/bin/sh | |
set -e | |
# You can get the latest commit SHA by looking at the latest tagged commit here: https://github.com/microsoft/vscode/releases | |
commit_sha="08a217c4d27a02a5bcde898fd7981bda5b49391b" | |
archive="vscode-server-linux-x64.tar.gz" | |
owner='microsoft' | |
repo='vscode' | |
# Auto-Get the latest commit sha via command line. |
const originalEnd = require('http').ClientRequest.prototype.end; | |
require('http').ClientRequest.prototype.end = function() { | |
try { | |
const headersSymbol = Object.getOwnPropertySymbols(this).find(k => k.toString().includes('kOutHeaders')) | |
const host = this[headersSymbol]['host'][1]; | |
let protocol = this.agent && this.agent.protocol ? this.agent.protocol : 'unknown:' | |
if (!this.agent && this[headersSymbol]['upgrade']) { | |
protocol = 'ws:'; | |
} | |
const url = `${protocol}//${host}${this.path}`; |