Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
@deoren
deoren / pip.md
Last active January 23, 2018 03:54 — forked from saurabhshri/pip.md
Install and use pip in a local directory without root/sudo access.

Install and use pip in a local directory without root/sudo access.

By: @saurabhshri

Why?

Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

@deoren
deoren / apt_pinning_priorities.md
Created December 13, 2017 17:36 — forked from JPvRiel/apt_pinning_priorities.md
Apt package pinning and priorities
@deoren
deoren / remote-git.md
Created December 18, 2017 20:30 — forked from Integralist/remote-git.md
Basic set-up of remote git repository on a standard server

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@deoren
deoren / using_git-svn.md
Last active August 13, 2023 01:01 — forked from rickyah/using_git-svn.md
A simple guide to git-svn

Getting started with git-svn

git-svn is a git command that allows using git to interact with Subversion repositories. git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.

Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion

Cloning the SVN repository

You need to create a new local copy of the repository with the command

function Get-Uptime
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
[string[]]$ComputerName = $env:COMPUTERNAME
@deoren
deoren / Get-DiskFree.ps1
Created January 22, 2018 16:38 — forked from mweisel/Get-DiskFree.ps1
PowerShell advanced function (script cmdlet) to query, retrieve, and display local drive/disk information. (http://binarynature.blogspot.com/2010/04/powershell-version-of-df-command.html)
function Get-DiskFree
{
[CmdletBinding()]
param
(
[Parameter(Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[Alias('hostname')]
[Alias('cn')]
@deoren
deoren / redact.py
Created February 26, 2018 14:33 — forked from alq666/redact.py
Redact certain patterns in rsyslog
#!/usr/bin/env python
"""A message modification plugin to remove credentials
Copyright (C) 2014 by Adiscon GmbH and Peter Slavov
Copyright (C) 2016 by Datadog
This file is part of rsyslog.
Licensed under the Apache License, Version 2.0 (the "License");
@deoren
deoren / rsyslogque.md
Created March 9, 2018 04:31 — forked from esfand/rsyslogque.md
Rsyslog queues

Main Queue

This object is available since 7.5.3. It permits to specify parameters for the main message queue. Note that only queue-parameters are permitted for this config object. This permits to set the same options like in ruleset and action queues. A special statement is needed for the main queue, because it is a different object and cannot be configured via any other object.

Note that when the main_queue() object is configured, the legacy $MainMsgQ... statements are ignored.

A Simple Example

main_queue(    
    queue.size="100000"      # how many messages (messages, not bytes!) to hold in memory

queue.type="LinkedList" # allocate memory dynamically for the queue. Better for handling spikes

@deoren
deoren / gist:6282552db527eb6ac08ebcb473481729
Created March 26, 2018 04:06 — forked from marvin/gist:1017480
syslog calculate facility and severity from PRI(priority)
example:
PRI = 191
To get the Facility
Divide the PRI number by 8.
191/8 = 23.875
The whole number part is the facility.
To get the Severity
@deoren
deoren / go-shebang-story.md
Created June 4, 2018 04:14 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.