Skip to content

Instantly share code, notes, and snippets.

sudo apt-get install texlive texlive-base texlive-lang-portuguese texlive-latex-recommended
@rnetonet
rnetonet / zimbra-rm-msg-from-everybody.bash
Created September 15, 2017 18:19
Remove an e-mail from all accounts in Zimbra
#!/bin/bash
# rm_message.sh user@domain.com subject
# create temp_file prior to calling this zmprov -l gaa | grep domain.com > /tmp/temp_email
if [ -z "$2" ]; then
echo "usage: rm_message.sh user@domain.com <subject>"
exit 0
else
addr=$1
subject=$2
ffmpeg -i input.mp4 -vf scale=640:360 -vcodec h264 -acodec aac -strict -2 output.mp4
@rnetonet
rnetonet / apt-install-latex.bash
Created March 14, 2018 20:55
apt-install-latex.bash
sudo apt-get install texlive texlive-extra-utils texlive-latex-extra texlive-lang-portuguese texlive-math-extra
sudo apt-get update -y; sudo apt-get full-upgrade -y; sudo apt-get autoremove -y;
sudo apt-get install -y autoconf bison build-essential curl freetds-dev gfortran ghostscript libatlas-base-dev libblas-dev libbz2-dev libcairo2 libcups2 libdbus-glib-1-2 libffi-dev libfreetype6-dev libgdbm-dev libgdk-pixbuf2.0-0 libglu1-mesa libhdf5-dev libjpeg-dev liblapack-dev libldap2-dev liblzma-dev libncurses5-dev libpango-1.0-0 libpangocairo-1.0-0 libpq-dev libreadline-dev libreadline6-dev libsasl2-dev libsm6 libsqlite3-dev libssl-dev libxinerama1 libxml2-dev libxmlsec1-dev libxslt1-dev libyaml-dev llvm make shared-mime-info tk-dev wget xz-utils zlib1g-dev
pip install -U setuptools
pip install -U pip
pip install -U pipenv
pip install -U virtualenv
pip install -U virtualenvwrapper
pip install -U black
pip install -U pylint
pip install -U pylint-django
sudo docker run -d -p 8787:8787 -e PASSWORD=rstudio -e ROOT=TRUE -v $HOME/Workspace/:/opt/Workspace/ --name rstudio rocker/rstudio
# Shell
ipython profile create
# Edit ipython_config.py
# Append:
#------------------------------------------------------------------------------
# Default Python prompt
#------------------------------------------------------------------------------
@rnetonet
rnetonet / read-access.sql
Created January 29, 2019 17:52 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@rnetonet
rnetonet / README.md
Created January 16, 2020 14:35 — forked from notheotherben/README.md
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.

@rnetonet
rnetonet / fix_mic_lenovo320.md
Created August 13, 2020 14:16 — forked from Therises/fix_mic_lenovo320.md
Fix microphone on Lenovo IdeaPad 320 on Ubuntu 18.04

In /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf:

  • Under [Element Internal Mic Boost] set volume to zero.
  • Under [Element Int Mic Boost] set volume to zero.
  • Under [Element Mic Boost] set volume to zero

Find your source name from the following command; mine is alsa_input.pci-0000_00_1f.3.analog-stereo

  $ pacmd list-sources | grep 'name:.*input'

Edit /etc/pulse/default.pa and add the following lines, where INPUT_NAME is name of the input source from above step: