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 service ssh restart |
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
# /etc/ssh/sshd_config | |
# ... | |
# Authentication | |
LoginGraceTime 120 | |
PermitRootLogin no | |
StrictModes yes | |
# ... |
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
# create the directory for ssh | |
mkdir -p ~/.ssh | |
# make sure it's editable only for the current user | |
chmod 700 ~/.ssh | |
# create the authorized keys file | |
touch ~/.ssh/authorized_keys | |
# use your favorite editor to add the public key | |
vim ~/.ssh/authorized_keys |
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
# SSH as root to your Digital Ocean Droplet | |
ssh root@[DROPLET_IP] | |
# create the new user | |
adduser example | |
# add new user to the sudo group | |
gpasswd -a example sudo | |
# logging in with the new user | |
su - example |
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
<?php | |
$req_url = 'https://YOURSITE.desk.com/oauth/request_token'; | |
$authurl = 'https://YOURSITE.desk.com/oauth/authorize'; | |
$acc_url = 'https://YOURSITE.desk.com/oauth/access_token'; | |
$api_url = 'https://YOURSITE.desk.com/api/v2'; | |
$conskey = 'CONSUMER_KEY'; | |
$conssec = 'CONSUMER_SECRET'; | |
$cbk_url = 'http://localhost:3000'; | |
session_start(); |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="//ajax.deskapi.com/libs/desk/opencti/current/interaction.min.js"></script> | |
<script> | |
(function() { | |
desk.ready(function() { | |
var form = document.querySelector('form') | |
, text = document.querySelector('input') | |
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
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Text; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace DeskApi | |
{ | |
/// <summary> |
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
// ==UserScript== | |
// @name Note | |
// @namespace http://www.desk.com/ | |
// @version 0.2 | |
// @description This script defaults new interactions in Desk.com Next Gen Agent to note rather than reply. | |
// @author Thomas Stachl <[email protected]> | |
// @match https://*/web/agent* | |
// @grant none | |
// ==/UserScript== |
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
/** | |
* USAGE Information | |
* 1. open the developer tools for a salesforce classic site | |
* 2. copy and paste the code of this snippet into the console | |
* 3. `createFromEmail('John Snow <[email protected]>'). | |
* | |
* WHAT does the script do? | |
* 1. it parses the email string into name and email address | |
* 2. it runs an API search for an account with the website `https://www.nightswatch.com/` | |
* 3. it splits the name part `John Snow` into firstname and lastname |
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 base64UrlDecode(str) { | |
str = (str + '===').slice(0, str.length + (str.length % 4)); | |
return new Buffer(str.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('utf8'); | |
} | |
function readSecret() { | |
return process.env.DESK_SHARED_KEY; | |
} | |
module.exports = { |