Skip to content

Instantly share code, notes, and snippets.

@frostytear
frostytear / iredmail_install.sh
Created March 20, 2017 15:53 — forked from leommoore/iredmail_install.sh
iRedMail - Install Script
#http://www.iredmail.org/index.html
#
#http://www.youtube.com/watch?v=uJ_AVoWbppc
#
#iRedMail on Nginx
#http://blog.eridlabs.com/using-iredmail-with-nginx-ubuntu-13-04-x64/
#Setup you domain
sudo su
@frostytear
frostytear / mkgit-centos6.sh
Created April 1, 2017 08:17 — forked from eyecatchup/mkgit-centos6.sh
Bash script to install the latest Git version on CentOS 6.x.
#!/usr/bin/env bash
# Install the latest version of git on CentOS 6.x
# Install Required Packages
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo yum install gcc perl-ExtUtils-MakeMaker
# Uninstall old Git RPM
sudo yum remove git
#!/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:
#
#
#
@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
@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 / 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 / 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 / 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]

{
"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."
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.