Skip to content

Instantly share code, notes, and snippets.

@Maximus5
Maximus5 / git.lua
Last active August 29, 2015 14:13 — forked from mikesigs/git.lua
---
-- This file is intended to be used with cmder
-- http://bliker.github.io/cmder/
--
-- Replace your existing <path_to_cmder>\config\git.lua with this file
-- This will append the branch status to your prompt, e.g. [ahead 1, behind 2]
-- It basically takes the output of git status -sb and appends it (with coloring) to the cmder prompt (before the lambda)
---
---
@Maximus5
Maximus5 / gist:2e83699883922f687874
Created January 23, 2015 08:52
Samle ConEmu's quake configuration
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2015-01-23 11:49:31" build="150119">
<value name="SingleInstance" type="hex" data="00"/>
<value name="KeyboardHooks" type="hex" data="01"/>
<value name="UseInjects" type="hex" data="01"/>
<value name="Update.CheckOnStartup" type="hex" data="00"/>
<value name="Update.CheckHourly" type="hex" data="00"/>
<value name="Update.ConfirmDownload" type="hex" data="01"/>
@Maximus5
Maximus5 / README.md
Last active August 29, 2015 14:17 — forked from fnichol/README.md

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@Maximus5
Maximus5 / csp.hang.log
Created June 19, 2015 14:11
scp hangs after uploading new file to sourceforge
> scp.exe -i %home%\.ssh\id_dsa_sf file.7z conemumaximus,conemu@frs.sourceforge.net:/home/frs/project/c/co/conemu/temp/
Executing: program /usr/bin/ssh host frs.sourceforge.net, user conemumaximus,conemu, command scp -v -t /home/frs/project/c/co/conemu/temp/
OpenSSH_6.7p1, OpenSSL 1.0.2c 12 Jun 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to frs.sourceforge.net [216.34.181.57] port 22.
debug1: Connection established.
debug1: identity file ***********\\id_dsa_sf type 2
debug1: key_load_public: No such file or directory
debug1: identity file ***********\\id_dsa_sf-cert type -1

Vim, Vundle and ConEmu on Windows

Let's start by getting it out on the table: Sublime Text is great, and version 3 should no longer be considered "abandonware" as of build 3065. Sublime Text served me very, very well over the years. That said, trying out new things is a major part of leveling-up, and in that vein Vim deserves a go. (And have you seen some of those thoughtbot guys flying around in Vim? It's awesome!)

Getting Vim up-and-running on your Windows machine doesn't have to be an all-day project. In this post, we'll walk through:

  • Installing gVim, which gives us both the "classic" command line version as well as the graphical version
  • Installing Vundle, the best way to handle Vim-enhancing packages
  • Installing ConEmu, a supercharged command line emulator for Windows
@Maximus5
Maximus5 / get-admin.bat
Last active March 18, 2024 17:28
Sample batch to run itself elevated
@echo off
echo Checking for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
echo Permission check result: %errorlevel%
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
"disable compatibility mode with Vi
set nocompatible
filetype off
"set rtp+=~/vimfiles/bundle/Vundle.vim
"call vundle#begin('~/vimfiles/bundle')
"Plugin 'VundleVim/Vundle.vim'
@Maximus5
Maximus5 / TrueColour.md
Created February 16, 2016 20:17 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
]0;fish /home/Max(BWelcome to fish, the friendly interactive shell
Type help(B for instructions on how to use fish
]0;fish /home/Max(B⏎ ~(B $ (B ~(B $ (Becho "***"echo(B "***"(B ~(B $ (Becho(B "***"(B
(B]0;echo /home/Max(B***
]0;fish /home/Max(B⏎ ~(B $ (B
$ pacman -S base-devel
:: There are 52 members in group base-devel:
:: Repository msys
1) asciidoc 2) autoconf 3) autoconf2.13 4) autogen 5) automake-wrapper 6) automake1.10 7) automake1.11 8) automake1.12 9) automake1.13 10) automake1.14 11) automake1.15
12) automake1.6 13) automake1.7 14) automake1.8 15) automake1.9 16) bison 17) diffstat 18) diffutils 19) dos2unix 20) file 21) flex 22) gawk 23) gdb 24) gettext
25) gettext-devel 26) gperf 27) grep 28) groff 29) help2man 30) intltool 31) lemon 32) libtool 33) libunrar 34) m4 35) make 36) man-db 37) pacman 38) patch 39) patchutils
40) perl 41) pkg-config 42) pkgfile 43) rcs 44) scons 45) sed 46) swig 47) texinfo 48) texinfo-tex 49) ttyrec 50) unrar 51) wget 52) xmlto
Enter a selection (default=all):
warning: asciidoc-8.6.9-4 is up to date -- reinstalling