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 | |
/etc/init.d/nginx stop | |
certbot renew --dry-run | |
certbot renew | |
cd <THE_FOLDER_WITH_CERTIFICATES> | |
openssl rsa -in privkey.pem -out privkey-rsa.pem | |
/etc/init.d/nginx configtest | |
/etc/init.d/nginx start | |
/etc/init.d/nginx status |
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
--- | |
#taken from here: https://github.com/68b32/ansible-role-mariadb/blob/7d01b08146c185064eb5c9d1b65b0f07c0e5eaee/tasks/mysql_secure_installation.yml | |
# | |
# Set root password | |
# UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root'; | |
# FLUSH PRIVILEGES; | |
- name: Set root user password | |
# If .my.cnf already exists, this will cause an mysql-root-password update. | |
mysql_user: |
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
--- | |
- name: Remove ipv6 hosts entry | |
replace: | |
dest: /etc/hosts | |
regexp: '^.*::\d\t.+|.*IPv6.*$' | |
#backup: yes | |
become: yes | |
# TODO FIND A WAY TO ELIMINATE EMPTY ROWS INSIDE /etc/hosts file | |
- name: Find ipv6 kernel parameter | |
shell: sysctl --all | egrep '^net.ipv6\..*disable' | awk '{print $1}' |
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
#USE THIS INSIDE RAILS CONSOLE | |
cursor = 0 | |
items = [] | |
while(cursor != -1) | |
result = $redis.scan(cursor, match: "sidekiq:sidekiq:status*") | |
cursor = result[0].to_i | |
items += result[1] | |
puts cursor | |
if cursor == 0 | |
cursor = -1 |
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
# found here: | |
# http://stackoverflow.com/a/28680027/1488217 | |
set_trace_func proc { | |
|event, file, line, id, binding, classname| | |
if event == "call" && caller_locations.length > 500 | |
fail "stack level too deep" | |
end | |
} |
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/sh -x | |
# | |
# found here: http://askubuntu.com/a/592127 | |
# | |
cd /usr/lib/vmware-tools/modules/source | |
tar xf vmhgfs.tar | |
grep -q d_u.d_alias vmhgfs-only/inode.c && echo "already patched" && exit 0 | |
sed -i -e s/d_alias/d_u.d_alias/ vmhgfs-only/inode.c | |
cp -p vmhgfs.tar vmhgfs.tar.orig | |
tar cf vmhgfs.tar vmhgfs-only |
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
cd /etc/yum.repos.d/ | |
wget http://archive.cloudera.com/gplextras5/redhat/6/x86_64/gplextras/cloudera-gplextras5.repo | |
yum check-update | |
yum install -y hadoop-lzo | |
dd if=/dev/random of=/tmp/test.bin bs=1000k count=10 | |
su - hdfs | |
hbase org.apache.hadoop.hbase.util.CompressionTest /tmp/test.bin lzo | |
echo "remember to restart all services on the node to take effect" | |
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
background no | |
font Sans:size=8 | |
#xftfont Sans:size=10 | |
use_xft yes | |
xftalpha 0.9 | |
update_interval 3.0 | |
total_run_times 0 | |
own_window yes | |
own_window_type normal | |
own_window_transparent yes |
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
require 'fileutils' | |
counter = 1 | |
if File.exists?('/usr/share/i18n/SUPPORTED') | |
FileUtils.copy_file('/usr/share/i18n/SUPPORTED','/tmp/lang_list.txt') unless File.exists?('/tmp/lang_list.txt') | |
file = File.open("/tmp/lang_list.txt", "r") | |
file_export = File.new("/tmp/lang_export.txt", "w+") | |
lang_set = Hash.new | |
output_list = "" | |
while (line = file.gets) | |
puts "#{counter}: #{line}" |
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
class CreatePlaces < ActiveRecord::Migration | |
# Rails migration for GeoWorldMap db into postgresql db | |
#(inspired by http://blog.inspired.no/populate-your-database-with-free-world-cities-countries-regions-in-2-minutes-using-a-rails-migration-273/ post) | |
#extract files from GeoWorldMap.zip archive from here | |
# http://www.geobytes.com/GeoWorldMap.zip | |
# | |
#and place them into #{Rails.root}/db/migrate/ | |
##the archive has 'cities.txt' file, rename it 'Cities.txt' | |
#mv cities.txt Cities.txt |