This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /opt/ && wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz | |
tar -xvzf asterisk-13-current.tar.gz | |
cd asterisk-13* | |
apt install build-essential -y | |
apt install libxml2-dev -y | |
apt install libncurses5-dev libreadline-dev libreadline6-dev -y | |
apt install libssl-dev -y | |
apt install uuid-dev -y | |
apt install libjansson-dev -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetDaysOfMonth($year, month){ | |
$start_date = "01-".$month."-".$year; | |
$start_time = strtotime($start_date); | |
$end_time = strtotime("+1 month", $start_time); | |
for($i=$start_time; $i<$end_time; $i+=86400) { | |
$list[] = date('Y-m-d', $i); | |
} | |
return $list; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getDaysInMonth = function(month,year) { | |
// Here January is 1 based | |
// //Day 0 is the last day in the previous month | |
return new Date(year, month, 0).getDate(); | |
// // Here January is 0 based | |
// // return new Date(year, month+1, 0).getDate(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hosts="$( | |
sqlite3 backup.db \ | |
'select ip from hosts' \ | |
)" | |
for host in $hosts; do | |
echo $host | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select strftime("%Y-%m-%d",datetime(createdate,'unixepoch')),count(*) as total from calls where pendente=1 group by strftime("%Y-%m-%d",datetime(createdate,'unixepoch')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func hexdec(s string) uint64 { | |
d := uint64(0) | |
for i := 0; i < len(s); i++ { | |
x := uint64(s[i]) | |
if x >= 'a' { | |
x -= 'a' - 'A' | |
} | |
d1 := x - '0' | |
if d1 > 9 { | |
d1 = 10 + d1 - ('A' - '0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
set -e | |
# | |
# Docker build calls this script to harden the image during build. | |
# | |
# NOTE: To build on CircleCI, you must take care to keep the `find` | |
# command out of the /proc filesystem to avoid errors like: | |
# | |
# find: /proc/tty/driver: Permission denied |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:darkmode = 0 | |
function! BgToggle() | |
if s:darkmode | |
execute 'set background=light' | |
execute 'colorscheme base16-atelier-dune-light' | |
execute 'AirlineTheme base16_atelier_dune_light' | |
let s:darkmode = 0 | |
return | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Test_IsPrimeHandler(t *testing.T) { | |
handler := setupMux() | |
type args struct { | |
req *http.Request | |
} | |
tests := []struct { | |
name string | |
args func(t *testing.T) args |
OlderNewer