<commit_before>#! /bin/bash
echo Etc/UTC > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

awk 'NR>1 {print $1}' /proc/cgroups |
while read -r a
do
  b="/tmp/warden/cgroup/$a"
  mkdir -p "$b"
done

mount -tcgroup -operf_event cgroup:perf_event /tmp/warden/cgroup/perf_event
mount -tcgroup -omemory cgroup:memory /tmp/warden/cgroup/memory
mount -tcgroup -oblkio cgroup:blkio /tmp/warden/cgroup/blkio
mount -tcgroup -ohugetlb cgroup:hugetlb /tmp/warden/cgroup/hugetlb
mount -tcgroup -onet_cls,net_prio cgroup:net_prio /tmp/warden/cgroup/net_prio
mount -tcgroup -onet_cls,net_prio cgroup:net_cls /tmp/warden/cgroup/net_cls
mount -tcgroup -ocpu,cpuacct cgroup:cpu /tmp/warden/cgroup/cpu
mount -tcgroup -ocpu,cpuacct cgroup:cpuacct /tmp/warden/cgroup/cpuacct
mount -tcgroup -ocpuset cgroup:cpuset /tmp/warden/cgroup/cpuset
mount -tcgroup -odevices cgroup:devices /tmp/warden/cgroup/devices
mount -tcgroup -ofreezer cgroup:perf_event /tmp/warden/cgroup/freezer

. ~/.profile
cd /root/cf_nise_installer/
./scripts/install_cf_release.sh
# sed -i "s/grep -q '\/instance' \/proc\/self\/cgroup/grep -q '\/docker' \/proc\/self\/cgroup/g" /var/vcap/packages/common/utils.sh

rsyslogd
NISE_IP_ADDRESS=${NISE_IP_ADDRESS:-`ip addr | grep 'inet .*global' | cut -f 6 -d ' ' | cut -f1 -d '/' | head -n 1`}
sed -i "/${NISE_DOMAIN}/d" /etc/dnsmasq.conf
echo "address=/$NISE_DOMAIN/$NISE_IP_ADDRESS" >> /etc/dnsmasq.conf

umount /etc/resolv.conf
echo "nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4" > /etc/resolv.conf
/etc/init.d/dnsmasq restart

find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_fin_timeout/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_recycle/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_reuse/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/net.ipv4.neigh.default.gc_thresh/a echo' ;

find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_fin_timeout/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_recycle/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_reuse/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/net.ipv4.neigh.default.gc_thresh/d' ;

sed -i 's/peer-heartbeat-timeout/peer-heartbeat-interval/g' /var/vcap/jobs/etcd/bin/etcd_ctl
sed -i 's/peer-heartbeat-timeout/peer-heartbeat-interval/g' /var/vcap/jobs/etcd/templates/etcd_ctl.erb

# sed -i 's/0.0.0.0/*/g' /var/vcap/jobs/postgres/config/postgresql.conf
# sed -i 's/shared_buffers = 128MB/shared_buffers = 256MB/g' /var/vcap/jobs/postgres/config/postgresql.conf

# sed -i 's/0.0.0.0/*/g' /var/vcap/jobs/postgres/bin/postgres_ctl
sed -i '/kernel.shmmax/d' /var/vcap/jobs/postgres/bin/postgres_ctl

# echo "log_min_messages = ERROR
# wal_buffers = 8MB
# checkpoint_completion_target = 0.7
# checkpoint_timeout = 10min
# checkpoint_segments = 20" >> /var/vcap/jobs/postgres/config/postgresql.conf

/var/vcap/bosh/bin/monit quit
/var/vcap/bosh/bin/monit
<commit_msg>dns fixes<commit_after>#! /bin/bash
echo Etc/UTC > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

awk 'NR>1 {print $1}' /proc/cgroups |
while read -r a
do
  b="/tmp/warden/cgroup/$a"
  mkdir -p "$b"
done

mount -tcgroup -operf_event cgroup:perf_event /tmp/warden/cgroup/perf_event
mount -tcgroup -omemory cgroup:memory /tmp/warden/cgroup/memory
mount -tcgroup -oblkio cgroup:blkio /tmp/warden/cgroup/blkio
mount -tcgroup -ohugetlb cgroup:hugetlb /tmp/warden/cgroup/hugetlb
mount -tcgroup -onet_cls,net_prio cgroup:net_prio /tmp/warden/cgroup/net_prio
mount -tcgroup -onet_cls,net_prio cgroup:net_cls /tmp/warden/cgroup/net_cls
mount -tcgroup -ocpu,cpuacct cgroup:cpu /tmp/warden/cgroup/cpu
mount -tcgroup -ocpu,cpuacct cgroup:cpuacct /tmp/warden/cgroup/cpuacct
mount -tcgroup -ocpuset cgroup:cpuset /tmp/warden/cgroup/cpuset
mount -tcgroup -odevices cgroup:devices /tmp/warden/cgroup/devices
mount -tcgroup -ofreezer cgroup:perf_event /tmp/warden/cgroup/freezer

. ~/.profile
cd /root/cf_nise_installer/
./scripts/install_cf_release.sh
# sed -i "s/grep -q '\/instance' \/proc\/self\/cgroup/grep -q '\/docker' \/proc\/self\/cgroup/g" /var/vcap/packages/common/utils.sh

rsyslogd
NISE_IP_ADDRESS=${NISE_IP_ADDRESS:-`ip addr | grep 'inet .*global' | cut -f 6 -d ' ' | cut -f1 -d '/' | head -n 1`}
sed -i "/${NISE_DOMAIN}/d" /etc/dnsmasq.conf
echo "address=/$NISE_DOMAIN/$NISE_IP_ADDRESS" >> /etc/dnsmasq.conf

if [ ! -f /etc/resolv.old ]; then
cp -p /etc/resolv.conf /etc/resolv.old
grep -i nameserver /etc/resolv.old > /etc/resolv.dnsmasq.conf
umount /etc/resolv.conf
echo "nameserver 127.0.0.1" > /etc/resolv.conf
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolv.dnsmasq.conf
echo "resolv-file=/etc/resolv.dnsmasq.conf" >> /etc/dnsmasq.conf
fi

/etc/init.d/dnsmasq restart

find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_fin_timeout/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_recycle/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_reuse/a echo' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/net.ipv4.neigh.default.gc_thresh/a echo' ;

find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_fin_timeout/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_recycle/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/tcp_tw_reuse/d' ;
find /var/vcap/jobs/*/bin/ -type f | xargs sed -i '/net.ipv4.neigh.default.gc_thresh/d' ;

sed -i 's/peer-heartbeat-timeout/peer-heartbeat-interval/g' /var/vcap/jobs/etcd/bin/etcd_ctl
sed -i 's/peer-heartbeat-timeout/peer-heartbeat-interval/g' /var/vcap/jobs/etcd/templates/etcd_ctl.erb

# sed -i 's/0.0.0.0/*/g' /var/vcap/jobs/postgres/config/postgresql.conf
# sed -i 's/shared_buffers = 128MB/shared_buffers = 256MB/g' /var/vcap/jobs/postgres/config/postgresql.conf

# sed -i 's/0.0.0.0/*/g' /var/vcap/jobs/postgres/bin/postgres_ctl
sed -i '/kernel.shmmax/d' /var/vcap/jobs/postgres/bin/postgres_ctl

# echo "log_min_messages = ERROR
# wal_buffers = 8MB
# checkpoint_completion_target = 0.7
# checkpoint_timeout = 10min
# checkpoint_segments = 20" >> /var/vcap/jobs/postgres/config/postgresql.conf

/var/vcap/bosh/bin/monit quit
/var/vcap/bosh/bin/monit

{'fraction_non_alphanumeric': 0.16680175068892852, 'fraction_numerical': 0.013616469443994165, 'mean_word_length': 3.607916355489171, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '707655', 'n_tokens_mistral': 2749, 'n_tokens_neox': 2669, 'n_words': 494}