Skip to content

Instantly share code, notes, and snippets.

View faddat's full-sized avatar

Jacob Gadikian faddat

View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / configuring-archlinux-ami.sh
Created May 26, 2009 21:19
Instructions for building an EC2 AMI for Arch Linux
#!/dev/null
# This 'script' is a set of instructions for preparing and bundling an Arch
# Linux AMI for Amazon's EC2. Bits are to be run on three different
# computers, and there is interaction required, so please follow along and
# run commands individually.
# PROTIP: THESE DON'T ACTUALLY WORK. That's why I'm pasting them here,
# attemping to get some input on what I'm doing wrong. When the instructions
# are ready for prime-time, I'll clean them up and post them to my blog. If
# you're really interested, watch for it there:
@marioBonales
marioBonales / .bashrc
Created January 19, 2012 03:56
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@dwayne
dwayne / 00-install-on-64-bit-ubuntu-14.04.md
Last active January 12, 2024 17:48
Installing node and npm on Ubuntu 12.04 LTS and 64-bit Ubuntu 14.04 LTS.
  1. Navigate to http://nodejs.org/download/ and on the Linux Binaries (.tar.gz) row click to download the 64-bit version of the current latest release.

  2. Say you've downloaded node-v0.10.7-linux-x64.tar.gz into the Downloads directory. Then, open the terminal and type the following:

$ cd ~/Downloads
$ mkdir -p ~/local/node
$ tar xzf node-v0.10.7-linux-x64.tar.gz -C ~/local/node --strip-components=1
$ echo '# Node Enviroment Setup' >> ~/.bashrc
$ echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.bashrc
@phgrau
phgrau / gist:4048239
Created November 9, 2012 21:07 — forked from anonymous/gist:4047604
a quick and dirty tips-n-tricks for ansible
Variables
==========
predefined variables :
- inventory_hostname (fqdn) (normally the same as ansible.fqdn)
- inventory_hostname_short
To know the return codes returned by ansible modules, just use plain ansible -vvv to see them :
ansible -i ~/ansible/arrfab.net/hosts/hosts.cfg -vvv -m copy -a 'src=files/sysinfo dest=/etc/sysinfo' tungstene.arrfab.net
tungstene.arrfab.net | success >> {
"changed": true,
@billputer
billputer / gist:5093503
Created March 5, 2013 19:41
install virtualbox guest additions on ubuntu/debian
VBOX_VERSION=4.2.8
sudo apt-get install build-essential linux-headers-$(uname -r)
wget http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso
sudo mkdir /media/vbox
sudo mount -o loop VBoxGuestAdditions_${VBOX_VERSION}.iso /media/vbox
sudo /media/vbox/VBoxLinuxAdditions.run --nox11
sudo umount /media/vbox
sudo rmdir /media/vbox
@jwebcat
jwebcat / gist:5122366
Last active March 25, 2024 18:25 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@smoser
smoser / ubuntu-cloud-virtualbox.sh
Last active April 2, 2024 21:07
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@ianatha
ianatha / make_me_pxeboot_server.sh
Last active November 28, 2017 00:36
Makes an Ubuntu box a PXEBoot server that serves CoreOS.
#!/bin/bash
COREOS_VERSION=147.0.1
apt-get install inetutils-inetd tftpd-hpa dhcp3-server -y
echo "RUN_DAEMON=\"yes\"" >> /etc/default/tftpd-hpa
echo "subnet 10.0.1.0 netmask 255.255.255.0 {
range 10.0.1.200 10.0.1.250;
option routers 10.0.1.1;
@matijs
matijs / README.md
Last active April 12, 2023 22:24
Resizing a partition and filesystem on a headless Raspberry Pi running Arch Linux using a USB drive

Resizing a partition and filesystem on a headless Raspberry Pi running Arch Linux using a USB drive

disclaimer: this worked for me, your mileage may vary. Your Pi, your responsibility :)

After putting Arch Linux on a 16GB SD card using these instructions, I ended up with about 14GB of free space.

Arch Linux uses one primary partition (/dev/mmcblk0p1) and an extended partition (/dev/mmcblk0p2) containing one logical partition (/dev/mmcblk0p5). The primary partition is the boot partition and the logical partition is the root partition. Rather than adding another primary partition I just wanted to resize the root partition and filesystem.

According to this bugreport parted no longer handles resizing of partitions and gparted needs a graphical environment to run. So I had to come up with something else to resize my partitions.

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件