Skip to content

Instantly share code, notes, and snippets.

@frostytear
frostytear / rst-vim.md
Created June 21, 2018 01:53 — forked from mgedmin/rst-vim.md
ReStructuredText + vim = ?

A list of interesting GH repos:

@frostytear
frostytear / Upgrade vim
Created June 19, 2018 09:31 — forked from yevrah/Upgrade vim
Update to Vim8 on Centos 7
# You may use this CentOS 7 repository on Fedora Copr for Vim 8 builds.
# https://copr.fedorainfracloud.org/coprs/mcepl/vim8/
#
# Run these commands on CentOS 7.
# Add this repository:
sudo curl -L https://copr.fedorainfracloud.org/coprs/mcepl/vim8/repo/epel-7/mcepl-vim8-epel-7.repo -o /etc/yum.repos.d/mcepl-vim8-epel-7.repo
# Upgrade Vim to vim 8:
Do:
================
1.name the directory something related to your project. For example, if your project is named "Twisted",
name the top-level directory for its source files Twisted. When you do releases, you should include a version number suffix: Twisted-2.5.
2.create a directory Twisted/bin and put your executables there, if you have any.
Don't give them a .py extension, even if they are Python source files.
Don't put any code in them except an import of and call to a main function defined somewhere else in your projects.
(Slight wrinkle: since on Windows, the interpreter is selected by the file extension,
your Windows users actually do want the .py extension.
So, when you package for Windows, you may want to add it.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Simple search engine\n",
"#### By Pravesh Koirala\n",
"\n",
"A search engine that will index given [toy] documents.. just to show how to do it."
@frostytear
frostytear / sysv.init.script.to.systemd.unit.file.md
Created April 20, 2018 10:50 — forked from houtianze/sysv.init.script.to.systemd.unit.file.md
Convert SysV Init scripts to Systemd Unit File

Let's say you have a SysV Init Script named foo

  1. Copy the file to /etc/init.d/foo

  2. Enable the SysV service: chkconfig --add foo

  3. Enable the SysV service: chkconfig foo on

  4. Start the service: service foo start. After this, systemd-sysv-generator will generate this file /run/systemd/generator.late/foo.service, copy this file to /etc/systemd/system by running: cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service

  5. Edit /etc/systemd/system/foo.service by running systemctl edit foo.service, add in the following line to foo.servie (this makes the service installable)

[Install]

@frostytear
frostytear / chrome_headless_screenshot.py
Created February 13, 2018 08:16 — forked from rverton/chrome_headless_screenshot.py
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@frostytear
frostytear / build.json
Created January 18, 2018 10:03 — forked from PHLAK/build.json
Packer QEMU / KVM example.
{
"variables": {
"ssh_user": "root",
"ssh_pass": "T@c0_Bu3n0"
},
"builders": [
{
@frostytear
frostytear / install-parallel-centos-6.sh
Created January 10, 2018 07:40 — forked from bzz/install-parallel-centos-6.sh
Install GNU Parallel on CentOS 6
#!/bin/bash
# Install parallel on CentOS 6.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
#wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo
yum install parallel
@frostytear
frostytear / sh_env_var_opts.sh
Created July 19, 2017 09:38 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
#!/bin/bash
# Author: Craig Russell
# Email: craig@craig-russell.co.uk
# Date: yyyy-mm-dd
# Usage: script.sh [-a|--alpha] [-b=val|--beta=val]
# Description:
#
#
#