Skip to content

Instantly share code, notes, and snippets.

View micheleberardi's full-sized avatar
:octocat:
Life is good

Michele micheleberardi

:octocat:
Life is good
  • Gricia AI
  • New York
  • 02:57 (UTC -05:00)
View GitHub Profile
import requests
def get_url(instagram_media_id,instagram_token):
 url = ""https://graph.facebook.com/v14.0/" + str(instagram_media_id) + "/insights?metric=impressions%2Cengagement%2Creach%2Csaved%2cvideo_views&access_token=" + str(instagram_token)
 r = requests.get(url)
 return r.json()
{
 'data': [
 {
 'name': 'impressions',
 'period': 'lifetime',
 'values': [
 {
 'value': 13
 }
 ],
[Unit]
Description=Redis persistent key-value database
After=network.target
[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf --daemonize no --supervised systemd
ExecStop=/usr/libexec/redis-shutdown
#Type=notify
User=redis
Group=redis
bind 127.0.0.1
protected-mode yes
port 6379
tcp-backlog 65384
unixsocket /tmp/redis_6379.sock
unixsocketperm 700
timeout 0
tcp-keepalive 300
daemonize no
supervised no
@micheleberardi
micheleberardi / nginx.conf
Last active November 7, 2022 19:11
nginx conf for nextJS
server {
listen 80;
server_name sb.domain.com;
return 301 https://sb.domain.com$request_uri;
}
server {
listen 443 ssl http2;
server_name sb.domain.com;
import boto3
def update_route53_record(hosted_zone_id, domain_name, action, ip_address, ttl=300):
client = boto3.client('route53')
# Check if the action is valid
if action not in ('UPSERT', 'DELETE'):
print("Invalid action. Use 'UPSERT' to add/update or 'DELETE' to remove.")
return