Skip to content

Instantly share code, notes, and snippets.

@plaisted
plaisted / add.sh
Created February 23, 2020 00:27
USG static DNS entry
If you want static entries on USG, try this:
as a root on usg create file
vi /etc/dnsmasq.d/dnsmasq.static.conf
put there some hosts
@xavierlacot
xavierlacot / USG-static-dns-entries.md
Created August 2, 2017 15:24
USG static dns entries
$ ssh username@192.168.0.1
$ sudo vi /etc/dnsmasq.d/dnsmasq.static.conf

Put there some hostnames <-> ip mappings:

address=/some.domain/192.168.0.123
address=/some.other.domain/167.112.237.24
@mattweber
mattweber / synstest.sh
Last active January 8, 2021 13:20
Multi-word query time synonyms in elasticsearch.
# delete old index if exists
curl -XDELETE 'http://localhost:9200/syns?pretty'
# create index with synonym analyzer and mapping
curl -XPUT 'http://localhost:9200/syns?pretty' -d '{
"settings" : {
"number_of_replicas": 0,
"number_of_shards": 1,
"index": {
"analysis": {
@adrienbrault
adrienbrault / purge.sh
Created September 24, 2012 10:02
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)