Skip to content

Instantly share code, notes, and snippets.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 10, 2021
Hyperlinks in Terminal Emulators
View Hyperlinks_in_Terminal_Emulators.md
@othyn
othyn / factorio_headless_guide.md
Last active Apr 26, 2021
How to setup a Factorio Headless Server
View factorio_headless_guide.md

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Just a note to newcomers: If there are any issues with the installation steps, people in the comments are doing a good job

@mdwhatcott
mdwhatcott / custom_json.go
Created Jul 29, 2015
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
View custom_json.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {
@marnix
marnix / Remove-File-Eventually.ps1
Created Nov 20, 2013
PowerShell command to delete a file, if possible immediately, and if it is in use at the next boot.
View Remove-File-Eventually.ps1
param(
[parameter(Mandatory=$true)]
[string] $path
)
# the code below has been used from
# https://blogs.technet.com/b/heyscriptingguy/archive/2013/10/19/weekend-scripter-use-powershell-and-pinvoke-to-remove-stubborn-files.aspx
# with inspiration from
# http://www.leeholmes.com/blog/2009/02/17/moving-and-deleting-really-locked-files-in-powershell/
# and error handling from
@janikvonrotz
janikvonrotz / ConnectRemoteDesktopusingKeePassCredentials
Created Nov 13, 2013
Connect Remote Desktop using KeePass Credentials #KeePass #EmbededPost
View ConnectRemoteDesktopusingKeePassCredentials
cmd://"C:\Windows\System32\cmd.exe" /c cmdkey.exe /generic:TERMSRV/{S:SERVER} /user:{S:DOMAIN}{USERNAME} /pass:{PASSWORD} & mstsc.exe /v:{S:SERVER} & cmdkey.exe /delete:TERMSRV/{S:SERVER}
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active May 11, 2021
JS: AngularJS Directive Attribute Binding Explanation
View angularjs_directive_attribute_explanation.md

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@leoapost
leoapost / gist:4318441
Created Dec 17, 2012
Delete all remote branches, except master
View gist:4318441
# Replace REMOTE_NAME with your remote name (e.g. origin)
git branch -r | grep REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push REMOTE_NAME :$line; done;
@afair
afair / tmux.cheat
Last active May 10, 2021
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
View tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &