Skip to content

Instantly share code, notes, and snippets.

View alexander-arce's full-sized avatar

Alex Arce alexander-arce

View GitHub Profile
@alexander-arce
alexander-arce / submodule-pull.sh
Created August 1, 2022 16:26 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'
SELECT pg_catalog.set_config('search_path', 'public', false);
@alexander-arce
alexander-arce / drop_objects.sql
Created May 3, 2020 00:59
Drop database objects
CREATE OR REPLACE FUNCTION drop_objects()
RETURNS VOID AS $$
DECLARE
rd_object RECORD;
v_idx_statement VARCHAR(500);
BEGIN
---1. Dropping all stored functions
@alexander-arce
alexander-arce / drop_schema.sql
Last active May 2, 2020 21:43
Drop public shcema
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
@alexander-arce
alexander-arce / prefix_issue.py
Last active April 20, 2020 17:07
Prefix commit message
#!/usr/bin/env python
# Original code https://andy-carter.com/blog/automating-git-commit-messages-with-git-hooks
# Create hooks directory mkdir -p ~/.git/hooks
# Config global hook path git config --global core.hooksPath ~/.git/hooks/
# save as prepare-commit-msg
__author__ = "Alex Arce"
__email__ = "alexander.arce@pm.me"
__license__ = "GPL"
__version__ = "1.0"
__credits__ = "Frank Hofmann "
@alexander-arce
alexander-arce / reset_msql_root_password.sh
Created May 15, 2018 15:22
Mysql Reset Root Password
systemctl stop mysql.service
/usr/bin/mysql_safe --skip-grant-tables
mysql -u root
use mysql;
update user set authentication_string=PASSWORD("**NEW-PASSWORD**") where User='root';
flush privileges;
quit;
systemctl start mysql.service
# Test new Password
mysql -u root -h localhost -p
@alexander-arce
alexander-arce / init.vm
Created October 30, 2017 19:45
Neovim Configuration
" Place in ~/.config/nvim
" vim-bootstrap
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
https://www.ianlewis.org/en/reversing-django-admin-urls
https://github.com/jsocol/django-adminplus
https://github.com/frankwiles/django-admin-views
http://www.pabloleanomartinet.com/adding-custom-admin-pages-django/
eval "$(ssh-agent -s)"
@alexander-arce
alexander-arce / Create user
Last active March 8, 2023 14:24
Etherpad Lite Install + Postgresql
sudo adduser --system --home=/opt/etherpad --group etherpad