Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile
@holms
holms / install-metasploit-debian.md
Last active October 10, 2020 14:13
metasploit install in debian wheezy

Debian Wheezy Metasploit Setup

Install depedencies

apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre subversion git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev ruby1.9.3 nmap -y
gem install --verbose --debug pcaprub wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler
@holms
holms / install-chef-server.md
Last active December 27, 2015 17:09
Provision your server with chef-server, using chef-solo (believe it's faster then by hand) See this manual if you wan't to know why - http://railsware.com/blog/2013/04/19/getting-started-with-chef-server-part-1/

INSTALL CHEF-SERVER

Use-case of this manual

We will setup chef-solo, and then, we'll provision your specified node with chef-server cookbook. Also I'll show how to setup your workstation with berkshelf and knife.

The use-case is to show how to work with chef repository, which you can store comfortably in git.

@holms
holms / app.rb
Created November 7, 2013 17:48 — forked from jgarber/app.rb
run_list(
'recipe[chef-solo-search]',
'recipe[rails_application]'
)
default_attributes(
rails: {
app: {name: "sample_app"},
deploy: {
repository: "https://github.com/jgarber/sample_app_2nd_ed.git"
{
"name": "**role-name**",
"chef_type": "role",
"json_class": "Chef::Role",
"default_attributes": {},
"override_attributes": {},
"description": "*role description*",
"run_list": [
"role[default]",
"hoge::nice"
@holms
holms / install-chef-solo.sh
Last active November 27, 2017 18:31
install chef-solo and bootstrap a node
#--------------------------------------------------------------------------------------------------------#
# #
# *** Chef repository setup together with chef-solo, knife-solo, libririan-chef and vagrant *** #
# #
# This guide is for people who has around 2-3 vm's (on vps or just dedicated server) with their side #
# project. My intension just to show you, how to create chef repository, and provision your vm's from #
# laptop/desktop without using chef server/client and additional fuss. Also this guide includes vargrant #
# setup just for testing your recipes. #
# -------------------------------------------------------------------------------------------------------#
@holms
holms / iptables-rules
Created October 22, 2013 15:02
Iptables default rules
#!/bin/bash
#
# iptables example configuration script
#
# Flush all current rules from iptables
#
iptables -F
#
# Allow SSH connections on tcp port 22
# This is essential when working on remote servers via SSH to prevent locking yourself out of the system
@holms
holms / gist:6999640
Last active December 25, 2015 15:39
Chroot And Mount Raid Or Actual Hard Disk From Rescue Kernel / CD
http://www.cyberciti.biz/faq/centos-rhel-linux-mount-raid-hard-disk-from-livecd/
Note: If you see the error chroot: '/usr/bin/bash': permission denied, remount with the exec permission: mount -o remount,exec /mnt/arch.
@holms
holms / gist:6999632
Created October 15, 2013 22:24
Accessing a raid logical volume from debian
Install lvm2:
$ sudo apt-get install lvm2
Load the necessary module(s):
$ sudo modprobe dm-mod
Scan your system for LVM volumes and identify in the output the volume group name that has your Fedora volume (mine proved to be VolGroup00):
$ /usr/libexec/qemu-kvm -m 256 -drive file=server.img -cdrom some.iso -boot d -net nic -net user -vnc :0
$ ssh -L 5900:127.0.0.1:5900 your_ip_here
@holms
holms / git-dir2repo.sh
Created July 25, 2013 10:21
Create repository from git subdirectory
git clone /XYZ /ABC # To clone your local repository
cd ABC
git remote rm origin
# only rewrite the HEAD branch and ignore tags and other branches
git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter subdirectory_to_repo HEAD
# then delete the backup reflogs so the space can be truly reclaimed (although now the operation is destructive)
git reset --hard
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
git gc --aggressive --prune=now