Skip to content

Instantly share code, notes, and snippets.

View nhed's full-sized avatar
💭
but why

Nevo Hed nhed

💭
but why
View GitHub Profile

Scratching my head regarding an answer on stackoverflow https://stackoverflow.com/a/69949813/652904

Setup

$ for x in {1..9}; do echo "${x}" > "${x}.txt"; git add "${x}.txt"; git commit -m "Adding ${x}.txt"; done
[dummy fc791a8] Adding 1.txt
 1 file changed, 1 insertion(+)
 create mode 100644 1.txt
[dummy c060042] Adding 2.txt
PIA's linux installer is not utilizing packages. Supposed to be run as non root with sudo prompts.
There might be a better way to do this.
THis script mocks few executables while running PIAs installer and then feeds data to FPM to build an RPM.
Probably could use more error checking and code cleanup.
  • some text

    now lets try a table as well second col just so we cross the line limit, cuz
    1 Yes
  • some other text

Install any serial prog like picocom

git clone https://github.com/npat-efault/picocom; cd picocom && make

Optional: Manually install in path as above makefile does not have an install rule

Edit sshd_config as follows:

  • make sure port 22 is uncommented & add your new custom port

Port 22

@nhed
nhed / gist:ec3f6b490f712fc90bf0e43a072c67a0
Last active August 2, 2016 16:43
RDP Snippet for LinCastor
#!/usr/bin/env bash
#
# LinCastor Helper for launching microsoft remote desktop on OSX from commandline
#
# Executed with lincastor (https://onflapp.wordpress.com/lincastor/)
# Lincastor RDP config:
# - title: RDP
# - choose one of the handlers: shell
# - shell body: exec ~/bin/rdp_launcher.sh
#
@nhed
nhed / !dropbox_upstart.md
Last active December 30, 2015 15:16
Dropbox upstart to start for all users that have linked their account (dropbox assumed installed, home assumed in /home)

Upstart config for dropbox

Why? So it runs even if not logged in

Prereq:

  • Download and install dropbox (packages from https://www.dropbox.com/install?os=lnx)
  • Run dropboxd once in your terminal (you will see a URL to paste to your browser where already logged in so that you can link this new machine). After linking is succesful - kill with -
# Test for when expression has GLOB characters
$ ls -l
total 8
-rw-r--r-- 1 nhed wheel 0 Dec 21 19:29 a
-rw-r--r-- 1 nhed wheel 0 Dec 21 19:29 b
-rw-r--r-- 1 nhed wheel 0 Dec 21 19:29 c
-rw-r--r-- 1 nhed wheel 0 Dec 21 19:29 d
-rw-r--r-- 1 nhed wheel 2 Dec 21 19:30 x.txt
#!/bin/bash
# based on http://stackoverflow.com/a/18647857/652904
declare PROGNAME="${0}"
function Usage()
{
local -i EXITCODE=${1}; shift
echo "${@}" >&2