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
import os | |
HOME_FOLDER = '/Users/cyriacthomas/' | |
NEW_DROPBOX_MACKUP_FOLDER = '/Users/cyriacthomas/Dropbox/Mackup/' | |
cmd = 'find {} -type l'.format(HOME_FOLDER) | |
files=os.popen(cmd).read() | |
_ = [] | |
commands = [] |
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
0 0 * * * /usr/bin/letsencrypt renew >> /var/log/le-renew.log | |
0 */12 * * * gitlab-rake gitlab:backup:create >> /var/log/gitlab-backup.log | |
0 0 * * * find /var/opt/gitlab/backups/ -name "*_gitlab_backup.tar" -mtime +1 -delete | |
0 0 * * 6 apt-get update && apt-get upgrade -y gitlab-ce |
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
<!-- http://codepen.io/pen/WoRdgW --> | |
<div class="logo"></div> |
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
awk '!(NR%<size>){i++;}{print > "<filename_>"i"<.extension>";}' i=1 <filename.extension> |
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
javascript:void%20function(){function%20e(e,n){var%20o=document.createElement(%22script%22);o.onload=function(){console.log(e+%22%20loaded%22),n()},o.onerror=function(o){console.log(e+%22%20errored%22,o),n(o)},o.src=e,document.body.appendChild(o)}function%20n(e,n){c.link=document.createElement(%22link%22),c.link.onload=function(){n()},c.link.onerror=function(e){n(e)},c.link.href=e,c.link.rel=%22stylesheet%22,c.link.type=%22text/css%22,document.body.appendChild(c.link)}function%20o(n){return%20window.jquery||window.$%3Fn():void%20e(c.jquery,n)}function%20t(){n(c.css,function(n){return%20n%3Fconsole.log(%22err%20loading%20css%22,n):void%20o(function(n){return%20n%3Fconsole.log(%22err%20loading%20jquery%22,n):void%20e(c.js,function(e){if(e)return%20console.log(%22err%20loading%20select2%20js%22,e);var%20n=[].slice.call(document.querySelectorAll(%22select%22));n.forEach(function(e){jQuery(e).select2({dropdownAutoWidth:!0})})})})})}var%20c={js:%22https://cdn.rawgit.com/select2/select2/3.5.4/select2.min.js%22,css:% |
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
import csv | |
mrows = [] | |
# Creates list of dict from csv | |
with open('final.csv', mode='r') as infile: | |
reader = csv.DictReader(infile) | |
for row in reader: | |
mrows.append(row) | |
header = row.keys() |
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
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: set hostname using hostname command | |
command: hostname {{ inventory_hostname }} | |
- name: set hostname in /etc/hostname | |
shell: echo {{ inventory_hostname }} > /etc/hostname | |
- name: Set ip_forward (ipv4) | |
sysctl: name="net.ipv4.ip_forward" value=1 sysctl_set=yes state=present reload=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
#!/bin/bash | |
# Slightly modified version from https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh | |
# Run with sudo ./openvpn-install.sh and not sudo sh ./openvpn-install.sh as read command has issues with external triggering of scripts | |
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS | |
# This script will work on Debian, Ubuntu, CentOS and probably other distros | |
# of the same families, although no support is offered for them. It isn't | |
# bulletproof but it will probably work if you simply want to setup a VPN on | |
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and | |
# universal as possible. |
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
# Usage: python google_contacts_cleaner.py input.vcf output.vcf | |
import sys | |
input_file = sys.argv[1] | |
output_file = sys.argv[2] | |
total_card_count = 0 | |
final_card_count = 0 | |
with open(input_file,'r') as f: |
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
gitlab-rake gitlab:backup:create | |
find /var/opt/gitlab/backups -mtime +7 -exec rm {} \; | |
s3cmd sync --skip-existing --delete-removed /var/opt/gitlab/backups/ s3://<s3-bucket-name>/gitlab/backups/ |
NewerOlder