Skip to content

Instantly share code, notes, and snippets.

@sagmor
sagmor / download-and-install.sh
Last active May 13, 2023 00:25 — forked from andrius/download-and-install.sh
Script to install Asterisk with Fax support and Adhearsion on Debian/Ubuntu
#!/bin/bash
# function to generate random password, on input requires an argument - lenght of password
genpasswd() {
local l=$1
[ "$l" == "" ] && l=20
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
# MySQL default root password
@sagmor
sagmor / Day 2.js
Last active September 19, 2019 04:16
Algorithms For Carito
// x = [1,5,7,4]
// return [5,6,4]
function pop(x) {
var n = [];
for (var i = 0; i < x.length -1; i++) {
n[i] = x[i+1];
}
return n
}
@sagmor
sagmor / Eating.md
Last active September 14, 2019 20:27

Foods:

  • Sandwiches: In chile we are really into sandwiches, with a huge variety of them to try, in a way, they are to Chile what Tacos are to Mexico
  • Empanadas: Pocket's of dough filled with food, the most traditionals are:
    • Pino: Meet and onion mixture (with a little bit of egg, 1 olive and 1-2 raisins)
    • Mariscos ❤️: (Seafood) one of my favorites made with an arbitrary mix of
    • Queso: (Cheese) traditionally it's just cheese, but can be mixed with other ingreedients (like chicken, mushrooms, shellfish or shrimps)
  • Humita: It's a corn dough steamed on it's own leafs (similar to the mexican tamale)
  • Pastel de choclo: The same filling of the empanada is covered with the same dough from the Humita
  • Traditional Preparations: These are common preparations that are reused with different ingredients to make a huge arrange of options
@sagmor
sagmor / Boxstarter.ps1
Last active July 7, 2018 06:03
Boxstarter Config
# https://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/sagmor/630a26cdd3119fa797ce9ee7ec0ba800/raw/ba208328590139805af38a3b2962acc32758d2b8/Boxstarter.ps1
### windows configs ###
Set-ExplorerOptions -showFileExtensions -EnableShowFullPathInTitleBar
### basic stuff ###
cinst 7zip
cinst 1password
# cinst steam
0xA74F25E13F984799B1b7cbd2157CC261e6f3d68c
@sagmor
sagmor / 1-freeswitch.sh
Created September 6, 2013 22:44
WIP: Freeswitch and Adhearsion Debian/Ubuntu Setup
###
# Install Freeswitch on Debian/Ubuntu
# Mostly taken from http://robbietilton.com/blog/?p=1057
apt-get install git-core build-essential autoconf automake libtool libncurses5 libncurses5-dev gawk libjpeg-dev libz-dev pkg-config<
cd /usr/local/src
git clone git://git.freeswitch.org/freeswitch.git
cd freeswitch
@sagmor
sagmor / 0-README.md
Last active October 7, 2015 01:38
Machine Bootstrap

Machine Bootstrap

The idea of this gist is to document all the needed steps to setup a working machine with all the stuff that I need during development.

Requirements

Command Line Tools for Xcode: Download them from XCode or directly from https://developer.apple.com/downloads

@sagmor
sagmor / working.m
Created April 12, 2012 22:52
Zebra Print Test
// This one gets locked
+ (void)print1WithAddress:(NSString *)printerAddress andPort:(NSInteger)printerPort
{
NSError *error = nil;
TcpPrinterConnection *connection = [[TcpPrinterConnection alloc] initWithAddress:printerAddress andWithPort:printerPort];
[connection open];
NSString *file =
@sagmor
sagmor / gist:1174827
Created August 27, 2011 01:17
Some minor hacks for console.fm on fluid
// ==UserScript==
// @name Console Hacks
// @description Some minor hacks for console.fm
// @include http://*console.fm/*
var lastFm = {
enabled: false,
key: "APIKEY",
secret: "SECRETKEY",
session: "SESSIONKEY"
@sagmor
sagmor / app_config.rb
Created July 21, 2011 23:00
Get an AppConfig file in your app
# This goes to Rails.root/lib
# Requires the hashie gem
::AppConfig = begin
config_file = File.expand_path('../../config/config.yml', __FILE__)
config = Hashie::Mash.new YAML.load_file( config_file )[ Rails.env ]
local_config_file = File.expand_path('../../config/config.local.yml', __FILE__)
if File.exists? local_config_file
config.merge! YAML.load_file( local_config_file )[ Rails.env ] || {}