This file contains 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
st2ctl stop | |
apt-get install --only-upgrade st2 st2chatops st2mistral st2web | |
/etc/init.d/mistral stop | |
/etc/init.d/mistral-api stop | |
/opt/stackstorm/mistral/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head | |
/etc/init.d/mistral start | |
/etc/init.d/mistral-api start | |
st2ctl start |
This file contains 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
apt-get remove apache2 -y | |
apt-get autoremove -y | |
curl https://repogen.simplylinux.ch/txt/sources_c74a15400e68208192ca8980c7a90e7b678f2822.txt | sudo tee /etc/apt/sources.list | |
sudo apt-get update --fix-missing |
This file contains 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
#define _GNU_SOURCE | |
#include <sys/wait.h> | |
#include <sys/utsname.h> | |
#include <sched.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define STACK_SIZE (1024 * 1024) /* Stack size for cloned child */ |
This file contains 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
""" | |
1. Make sure you install Pillow using `pip install Pillow` at the command line | |
2. Call this script with the path to the picture as the parameter, e.g. | |
> python pillow.py my_face.jpg | |
3. This will support PNG, JPEG, TIFF and BMP images | |
4. Upload the my_image.jpg file to complete | |
""" | |
# Import Pillow features. | |
from PIL import Image, ImageFilter, ImageEnhance |
This file contains 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 pandas | |
import sys | |
import six | |
from pluralsight.licensing import LicensingAPIClient | |
import pluralsight.exceptions | |
import colorlog | |
import logging | |
handler = colorlog.StreamHandler() |
This file contains 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 libcloud | |
cls = libcloud.get_driver(libcloud.DriverType.DNS, libcloud.DriverType.DNS.DNSIMPLE) |
This file contains 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 requests | |
response = requests.get('https://my-cloud.com/api/v1/servers/') | |
response.json() |
This file contains 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 requests | |
response = requests.request('get', 'https://my-cloud.com/api/v1/servers/') | |
response.json() |
This file contains 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 requests | |
import json | |
my_data = { | |
'server': '1234' | |
} | |
my_auth = { | |
'Authorization': 'Bearer dfg90823jrofiowfi4-0r' | |
} | |
response = requests.post('https://my-api.service.com/v1/servers', data=json.dumps(my_data), |
This file contains 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 requests | |
import json | |
with requests.Session() as sess: | |
my_data = { | |
'server': '1234' | |
} | |
sess.headers['Authorization'] = 'Bearer dfg90823jrofiowfi4-0r' | |
response = sess.post('https://my-api.service.com/v1/servers', json=my_data) | |
data = sess.get('https://my-api.service.com/v1/servers/1234').json() |