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
| export class EnumMapper { | |
| static ToNameValue = function (enumType) { | |
| let names: any[] = []; | |
| for(let n in enumType) { | |
| if(typeof enumType[n] === 'number') { | |
| names.push({name: n, value: enumType[n]}); | |
| } | |
| } | |
| return names | |
| } |
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
| sudo apt-get update; | |
| sudo apt-get install apache2-utils; | |
| sudo sh -c "echo -n 'topic:' >> /etc/nginx/.htpasswd"; | |
| sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"; | |
| sudo htpasswd -c /etc/nginx/.htpasswd topic | |
| # if you come back to add more, leave out the -c | |
| # add the following 2 lines to your nginx config (at the location or server level) | |
| # auth_basic "Restricted Content"; | |
| # auth_basic_user_file /etc/nginx/.htpasswd; |
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
| import xlrd | |
| def exceltodict(filename, sheetindex, rowstoskip): | |
| workbook = xlrd.open_workbook(filename) | |
| worksheet = workbook.sheet_by_index(sheetindex) | |
| columnnames = [] | |
| for col in range(worksheet.ncols): |
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
| [Unit] | |
| Description=Nginx | |
| After=syslog.target network.target | |
| [Service] | |
| Type=forking | |
| ExecStartPre=/opt/nginx/sbin/nginx | |
| ExecStart=/opt/nginx/sbin/nginx | |
| ExecReload=/opt/nginx/sbin/nginx -s reload |
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
| use warnings; | |
| use strict; | |
| use LWP::UserAgent; | |
| use Try::Tiny; | |
| #This will go to the url, and tell you where you land after following | |
| #any redirects | |
| sub newUrl { | |
| my $oldUrl = shift; |
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
| import xml.etree.ElementTree as ET | |
| import requests | |
| from datetime import datetime | |
| from hashlib import md5 | |
| def fetchcalldata(startdate, enddate, username, password): | |
| """ | |
| Returns XML representing all calls in the defined date range | |
| Params: | |
| startdate - The beginning of the date range |