Skip to content

Instantly share code, notes, and snippets.

View bergerx's full-sized avatar
🙂

Bekir Dogan bergerx

🙂
View GitHub Profile
@bergerx
bergerx / gist:46e226ceb385e28aa695e7d48c4b1ec4
Created July 27, 2016 14:53
Recent OpenShift Rleases as of 2016-07-27
https://access.redhat.com/support/policy/updates/openshift
https://github.com/openshift/origin/releases
https://access.redhat.com/documentation/en/openshift-enterprise/3.2/single/release-notes/
2016-07-20 enterprise -- RHBA-2016:1466 - OpenShift Enterprise 3.2.1.9 security and bug fix update
2016-07-14 origin v1.2.1
2016-07-05 enterprise -- RHBA-2016:1383 - OpenShift Enterprise 3.2.1.4 bug fix and enhancement update
2016-06-27 enterprise -- RHBA-2016:1343 - OpenShift Enterprise 3.2.1.1 bug fix and enhancement update (Docker 1.10 Now Supported) only manual upgrades are possible from 3.2.x
2016-06-21 origin v1.3.0-alpha.2
2016-06-07 enterprise -- RHBA-2016:1208 - atomic-openshift-utils Bug Fix Update
@bergerx
bergerx / main.yml
Created July 5, 2016 12:09
A sample for managing containers on ubuntu using ansible
- name: prepare calico-node upstart service file
template: src=roles/docker/templates/upstart-docker-instance.j2.j2 dest="/etc/init/{{ item.service_name }}.conf"
tags:
- service
- calico
with_items:
- service_name: calico-node
docker_name: calico-node
docker_run: >
/usr/bin/docker run --rm \
@bergerx
bergerx / gist:3176300
Created July 25, 2012 13:53
reply to gist: 3176161
def create_counter():
scope={'i':0}
def increment():
scope['i'] +=1
print scope['i']
return increment
count = create_counter()
@bergerx
bergerx / gist:d6a8fb52a7ed92cfb159
Last active August 29, 2015 14:27
own no-ip service with route53
sudo pip install awscli
mkdir ~/.aws
cat <<EOF > credentials
[default]
aws_access_key_id = AKIA***
aws_secret_access_key = ***
EOF
cat <<EOF > bin/update-ev-bdgn-net
@bergerx
bergerx / ubuntu-airport-unlimited--wireless-connection
Last active August 29, 2015 14:26
resete mac address for airport wifi restriction
#!/bin/bash
# http://www.tautvidas.com/blog/2012/01/free-airport-wifi/
sudo ifconfig wlan0 down
/usr/bin/nmcli nm wifi off
sudo macchanger -r wlan0
/usr/bin/nmcli nm wifi on
while ! nmcli nm | grep ' connected'; do sleep 1; done
/home/local/ANT/bekir/bin/Firefox/firefox -P default --private-window hede.com
@bergerx
bergerx / gist:b85f6063070ea619cd83
Last active August 29, 2015 14:25
python memory error test
ubuntu@ubuntu1:~$ mkdir python-memory
ubuntu@ubuntu1:~$ cd python-memory/
ubuntu@ubuntu1:~/python-memory$ bash
ubuntu@ubuntu1:~$ sudo mkdir /sys/fs/cgroup/memory/hede
ubuntu@ubuntu1:~/python-memory$ cat /sys/fs/cgroup/memory/hede/memory.limit_in_bytes
18446744073709551615
ubuntu@ubuntu1:~/python-memory$ sudo tee /sys/fs/cgroup/memory/hede/memory.limit_in_bytes
50000000
50000000
ubuntu@ubuntu1:~/python-memory$ cat /sys/fs/cgroup/memory/hede/memory.limit_in_bytes
@bergerx
bergerx / gist:f3538e023862504072ad
Created July 15, 2015 16:35
auto heal for mysql replication
TODO: not complete, not even close
# These would be needed to implement this
# * zk - for a zookeeper connection
# * marathon - this services entry in marathon, for getting information about service, peer instances and peers' health check
# init() and join() is application specific functions.
# init() is for initializing the app cluster and will also be the
# very first node in the cluster.
# join() will be called for adding the new instance (maybe replicas) to existing cluster,
@bergerx
bergerx / gist:0b64f90cc66d666519fe
Created July 1, 2015 13:00
mesos-dns-marathon.json
{
"cpus": 0.1,
"mem": 102,
"id": "mesos-dns",
"instances": 1,
"constraints": [["hostname", "CLUSTER", "192.168.0.23"]],
"env": {
"MESOS_DOCKER_ZK": "zk://192.168.0.23:2181,192.168.0.26:2181,192.168.0.27:2181/mesos",
"MESOS_DNS_MASTERS": "192.168.0.23:5050,192.168.0.26:5050,192.168.0.27:5050",
"MESOS_DNS_RESOLVERS": "8.8.8.8",
ubuntu@ubuntu1:~$ sudo mkdir /etc/mesos-slave/attributes
ubuntu@ubuntu1:~$ echo attribute-value-here | sudo tee /etc/mesos-slave/attributes/attribute-name-here
ubuntu@ubuntu1:~$ sudo service mesos-slave restart
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: Failed to perform recovery: Incompatible slave info detected.
...
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: ------------------------------------------------------------
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: To remedy this do as follows:
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: Step 1: rm -f /tmp/mesos/meta/slaves/latest
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: This ensures slave doesn't recover old live executors.
@bergerx
bergerx / gist:36b725cd466c9f276a1c
Created July 27, 2014 20:34
time zone correction on uploaded images to flickr
import arrow
import flickr_api
tag='timeshift'
hours=-10
flickr_authfile = 'flickr.auth'
flickr_username = 'bergerx'
flickr_api.set_auth_handler(flickr_authfile)
#user = flickr_api.Person.findByUserName(flickr_username)