Skip to content

Instantly share code, notes, and snippets.

View ruiteix's full-sized avatar
🏠
Working from home

ruiteix

🏠
Working from home
View GitHub Profile
@ruiteix
ruiteix / syslog-injection.sh
Created November 29, 2021 11:20 — forked from mdub/syslog-injection.sh
Redirect STDOUT and STDERR into syslog, using "logger", and bash process substitution
# Redirect STDOUT/STDERR into syslog
exec > >(logger -p user.info) 2> >(logger -p user.warn)
docker ps -f status=running --format "{{.ID}} {{.CreatedAt}}" | while read id cdate ctime _; do if [[ $(date +%s -d "$cdate $ctime") -lt $(date +%s -d '1 days ago') ]]; then docker stop $id && docker rm $id; fi; done
@ruiteix
ruiteix / postgres_unlogged_tables.sql
Created May 27, 2019 08:19
Postgres unlogged tables
-- creation table unlogged
CREATE UNLOGGED TABLE name (
-- ...
);
-- convertir une table
ALTER TABLE name SET UNLOGGED;
-- Lister les tables unlogged
@ruiteix
ruiteix / Clone repository from github to gitlab
Last active April 4, 2019 13:53
Clone repository from github to gitlab
git clone --bare git@github.com:ruiteix/<repo_name_src>.git
git remote add gitlab git@gitlab.com:ruiteix/<repo_name_dst>.git
cd <repo_name_src>.git
git remote add gitlab git@gitlab.com:ruiteix/<repo_name_dst>.git
git push --mirror gitlab
@ruiteix
ruiteix / Ansible Let's Encrypt Nginx setup
Created March 17, 2019 16:26 — forked from mattiaslundberg/Ansible Let's Encrypt Nginx setup
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@ruiteix
ruiteix / wordpress-domain-migration.sql
Created January 3, 2019 16:32
wordpress domain migration
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@ruiteix
ruiteix / onename.txt
Created April 30, 2016 17:28
onename
Verifying that +ruiteix is my blockchain ID. https://onename.com/ruiteix