Skip to content

Instantly share code, notes, and snippets.

@iMilnb
iMilnb / boto3_hands_on.md
Last active October 19, 2022 09:15
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@niksumeiko
niksumeiko / git.migrate
Last active May 10, 2024 02:41
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@crashdump
crashdump / zbx-exim-stats.sh
Created June 3, 2013 12:25
A simple Zabbix statistics pusher. It check and report these values: - Number of running processes exim4 (trigger if 0) - Mails Queue Size (trigger if >500 and >1000) - Mails Received - Mails Error - Mails Received Size in Bytes - Mails Delivered - Mails Delivered Size in Bytes Import the template. Assign to you hosts. Cron the .sh.. You're good…
#!/bin/bash
# Set Variables
EXIMLOG=/var/log/exim4/mainlog
MYLOG=/tmp/exim_status.log
OFFSETFILE=/tmp/eximstatusoffset.dat
EXIMSTATS=/usr/sbin/eximstats
LOGTAIL=/usr/sbin/logtail
ZABBIX_SENDER=/usr/bin/zabbix_sender
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf
# use the npm mirror:
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
# you can reset this later with npm set registry npm set registry https://registry.npmjs.org/
# then use it normally:
npm install express
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh