Skip to content

Instantly share code, notes, and snippets.

View grambas's full-sized avatar

Mindaugas Milius grambas

View GitHub Profile
@grambas
grambas / portforward.sh
Last active January 23, 2024 10:04 — forked from codeinthehole/portforward.sh
bashrc port forward helper
# add these functions in ~/.bashrc
#
# Easier port forwarding - usage:
#
# $ portforward 9204 stageX localhost 9200
#
# where 'stageX' is an alias from ~/.ssh/config
# 9200 is the remote port on localhost
# 9204 is local port
#
@grambas
grambas / git.migrate
Last active February 16, 2022 07:51 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@grambas
grambas / git-pull-all
Created February 16, 2022 07:50 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@grambas
grambas / install_netextender_ubuntu_64_bit
Created June 3, 2019 17:58 — forked from egobude/install_netextender_ubuntu_64_bit
Install NetExtender | Ubuntu 64 Bit
1. go to https://sslvpn.demo.sonicwall.com/cgi-bin/welcome
2. log in with demo/password
3. click on NetExtender icon, this will download a tar.gz with the client
4. sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.6
5. sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6
6. un-tar the client, make install script executable and launch install
@grambas
grambas / trav-get-names.js
Last active January 21, 2019 19:18 — forked from Yiin/userscript.js
[Userscripts]
// ==UserScript==
// @name Unnamed Script 760860
// @version 1
// @grant GM.xmlHttpRequest
// get all players who sent reinforcement
// ==/UserScript==
(async () => {
const rows = [...document.querySelectorAll('#overview > tbody > tr')];
const thisPlayer = document.getElementsByClassName('playerName')[0].childNodes[3].innerHTML;
<?php
/**
Send message to slack channel.
$hook can be created at https://mindau.slack.com/apps/A0F7XDUAZ-incoming-webhook
*/
function sendLog($title, $msg)
{
$hook = "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$data = array(
'channel' => '#logging',
@grambas
grambas / The Technical Interview Cheat Sheet.md
Created September 21, 2016 08:42 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.