Skip to content

Instantly share code, notes, and snippets.

View tsolar's full-sized avatar

Tomás Solar Castro tsolar

  • Santiago, Chile
View GitHub Profile
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 27, 2024 03:36
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@tsolar
tsolar / timezone_select.rb
Last active July 24, 2023 12:28
time zone select rails, with canonical name in value
form.select :timezone, ActiveSupport::TimeZone.all.map{|tz| [ "(GMT#{tz.formatted_offset}) #{tz.name}", tz.tzinfo.canonical_zone.name] }, {prompt: "Elija zona horaria"}, class: 'form-control'
{
"editor.insertSpaces": true,
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.formatOnType": false,
"editor.wordBasedSuggestions": false,
"editor.trimAutoWhitespace": false,
"gitlens.hovers.avatars": false,
"gitlens.hovers.currentLine.details": false,
@tsolar
tsolar / elasticsearch.md
Created March 5, 2021 16:18 — forked from dominicsayers/elasticsearch.md
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@tsolar
tsolar / .fehbg
Last active March 1, 2021 03:54
change wallpaper with feh
feh --no-fehbg --bg-fill $(find "${HOME}/Pictures/wallpapers/" -type f -name *.jpg | shuf -n 1)
@tsolar
tsolar / phpmyadmin
Created September 3, 2013 21:00
phpmyadmin nginx config
server {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
@tsolar
tsolar / gist:9d93d2e20304c9c7e52b59ca7ffa200a
Last active September 13, 2020 17:28
postgresql create database
su - postgres
psql
CREATE ROLE rolename WITH LOGIN PASSWORD 'password';
CREATE DATABASE databasename OWNER rolename;
# working 2020-09-13
sudo -u postgres -i
psql
CREATE ROLE tom WITH LOGIN PASSWORD 'password';
@tsolar
tsolar / Vagrantfile
Created May 4, 2018 03:40
Vagrantfile to run rails projects
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@tsolar
tsolar / .powerline-shell.json
Last active December 4, 2017 14:04
powershell config
{
"segments": [
"time",
"ruby_version",
"virtual_env",
"username",
"hostname",
"ssh",
"cwd",
"git",
@tsolar
tsolar / Postman.desktop
Created June 1, 2017 16:27 — forked from pierremonico/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;