This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Marcus Furlong <[email protected]> 4/4/2012 | |
# Pin vcpus on xen | |
import sys | |
sys.path.insert(1, '/usr/lib/xen-4.0/lib/python') | |
sys.path.insert(1, '/usr/lib/xen-4.0/lib/python/xen/xm') | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PACKER_LOG=1 packer build -only=vmware-iso template-vnpf.json | |
2016/12/01 12:36:37 [INFO] Packer version: 0.12.0 | |
2016/12/01 12:36:37 Packer Target OS/Arch: linux amd64 | |
2016/12/01 12:36:37 Built with Go Version: go1.7.3 | |
2016/12/01 12:36:37 Detected home directory from env var: /root | |
2016/12/01 12:36:37 Using internal plugin for parallels-pvm | |
2016/12/01 12:36:37 Using internal plugin for digitalocean | |
2016/12/01 12:36:37 Using internal plugin for qemu | |
2016/12/01 12:36:37 Using internal plugin for virtualbox-ovf | |
2016/12/01 12:36:37 Using internal plugin for amazon-ebs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"execute_command": "echo {{user `ssh_pass`}}|sudo -S sh '{{.Path}}'", | |
"environment_vars": [ | |
"ssh_name={{user `ssh_name`}}", | |
"ssh_pass={{user `ssh_pass`}}" | |
], | |
"override": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016/12/04 10:45:03 packer: 2016/12/04 10:45:03 starting remote command: echo radware|sudo -S sh '/tmp/script_6106.sh' | |
2016/12/04 10:45:03 ui: vmware-iso: Reading package lists... | |
vmware-iso: Reading package lists... | |
2016/12/04 10:45:04 ui: vmware-iso: Building dependency tree... | |
vmware-iso: Building dependency tree... | |
2016/12/04 10:45:04 ui: vmware-iso: Reading state information... | |
vmware-iso: Reading state information... | |
2016/12/04 10:45:04 ui: vmware-iso: The following extra packages will be installed: | |
vmware-iso: The following extra packages will be installed: | |
2016/12/04 10:45:04 ui: vmware-iso: libdumbnet1 libicu52 zerofree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How can I get the architecture of a binary file? | |
readelf -h <archive>.a | grep 'Class\|File\|Machine' | |
[00:32:15] /usr/lib $ readelf -h libxslt.a | grep 'Class\|File\|Machine' | |
File: libxslt.a(attrvt.o) | |
Class: ELF32 | |
Machine: Intel 80386 | |
File: libxslt.a(xslt.o) | |
Class: ELF32 | |
Machine: Intel 80386 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/27028240/gnu-configure-options-for-binutils-gcc-glib | |
# https://gcc.gnu.org/wiki/InstallingGCC | |
# https://gcc.gnu.org/ml/gcc-help/2008-02/msg00356.html | |
# Rebuild GCC 4.9.3 | |
# Get all deb files: | |
apt-get --download-only --reinstall -o Dir::Cache="/root/4.9" -o Dir::Cache::archives="./" install gcc-4.9-multilib | |
# | |
mkdir /root/toolchain_src/ && cd /root/toolchain_src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#binutils 2.22 | |
dpkg-source -x binutils_2.22-6ubuntu1.3.dsc | |
cd binutils-2.22/ | |
./configure --prefix=/opt/tools/dev-tools-4.9 \ | |
--exec-prefix=/opt/tools/dev-tools-4.9 \ | |
--with-sysroot=/ --enable-multilib \ | |
--with-lib-path=/opt/tools/dev-tools-4.9/lib \ | |
--disable-werror --enable-shared \ | |
--enable-targets=x86_64-linux-gnu,i686-linux-gnu,x86_64-pc-mingw32,i686-pc-mingw32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql_host=.us-east-1.rds.amazonaws.com | |
for i in `echo '\d' | psql -h ${psql_host} -U postgres -d informationmodel |grep public|awk '{print $3}'`; do psql -h ${psql_host} -U postgres -d informationmodel -c "grant all on table $i to portal;"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# build prefix | |
export BUILD_PATH="/opt/tools/dev-tools-4.7" | |
# the directory of the script | |
DIR="/tmp" | |
# the temp directory used, within $DIR | |
WORK_DIR=`mktemp -d -p "$DIR"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH | |
# Disable root login in SSH | |
sed -i "s/^PermitRootLogin.*/PermitRootLogin no/g" /etc/ssh/sshd_config | |
# Disable | |
sed -i "s/^PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config | |
# How to disable user password | |
sed -i "s/^user1.*/user1::16887::::::/g" /etc/shadow |
OlderNewer