Skip to content

Instantly share code, notes, and snippets.

@g0053
g0053 / download_flickr_image.py
Created Jun 7, 2021 — forked from yunjey/download_flickr_image.py
downloading images from flickr using python-flickr
View download_flickr_image.py
# First, you should install flickrapi
# pip install flickrapi
import flickrapi
import urllib
from PIL import Image
# Flickr api access key
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True)
View Solution for mysql Warning: Using a password on the command line interface can be insecure
# Let us consider the following typical mysql backup script:
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database
# It succeeds but stderr will get:
# Warning: Using a password on the command line interface can be insecure.
# You can fix this with the below hack:
credentialsFile=/mysql-credentials.cnf
echo "[client]" > $credentialsFile
echo "user=$mysqlUser" >> $credentialsFile
echo "password=$mysqlPassword" >> $credentialsFile
@g0053
g0053 / mysql-docker.sh
Created Dec 23, 2020 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@g0053
g0053 / fetch_google_image.py
Created Dec 3, 2020 — forked from grifball/fetch_google_image.py
Download a random picture from Google image search.
View fetch_google_image.py
#!/usr/bin/env python
# coding: utf-8
# Download a random picture from Google image search.
#
# Usage:
# $ fetch_google_image.py cat cute # Download a cute cat picture
import os
import sys
@g0053
g0053 / fetch_google_image.py
Created Dec 3, 2020 — forked from alkc/fetch_google_image.py
Download a random picture from Google image search, using Python 3.
View fetch_google_image.py
#!/usr/bin/env python3
# coding: utf-8
# Download a random picture from Google image search.
#
# Usage:
# $ fetch_google_image.py cat cute # Download a cute cat picture
import os
import json
@g0053
g0053 / unsplash_wallpaper.sh
Created Dec 1, 2020 — forked from fpgaminer/unsplash_wallpaper.sh
Downloads a random image from Unsplash and sets the wallpaper every so often (currently only works with Gnome/Unity/Cinnamon/etc)
View unsplash_wallpaper.sh
#!/bin/sh
while :
do
wget -q -O unsplash_wallpaper.jpg https://unsplash.it/1920/1080/?random
gsettings set org.gnome.desktop.background picture-uri file://$PWD/unsplash_wallpaper.jpg
sleep 1h # Change this if you want a different update frequency (e.g. 30m, 12h, 24h, etc...).
done
@g0053
g0053 / index.sh
Created Mar 16, 2020 — forked from maxogden/index.sh
ffmpeg timelapse and rtsp streaming
View index.sh
# rename jpegs to be datetime based
jhead -n%Y%m%d-%H%M%S **/**.jpg
# timelapse from jpegs. r = fps
ffmpeg -r 15 -pattern_type glob -i '*.jpg' -s hd720 -vcodec libx264 -crf 25 OUTPUT.MP4
# rtsp stream to youtube
@g0053
g0053 / bluetooth_sendsms.py
Created Dec 23, 2019 — forked from lidio601/bluetooth_sendsms.py
Python test to send SMS to a phone via Bluetooth
View bluetooth_sendsms.py
import bluetooth
#import serial
sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
# sockfd.connect(('00:15:2A:D1:F4:8A', 1)) # BT Address
sockfd.connect(('00:1B:EE:35:0A:B1', 1)) # BT Address
sockfd.send('ATZ\r')
sockfd.send('AT+CMGF=1\r')
sockfd.send('AT+CMGS="+390111001101"\r') # TO PhoneNumber
View VMware Workstation 15.x.x serial key
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@g0053
g0053 / GoDaddySSLHAProxy.md
Created Jun 18, 2019 — forked from sethwebster/GoDaddySSLHAProxy.md
Creating a PEM for HaProxy from GoDaddy SSL Certificate
View GoDaddySSLHAProxy.md

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/yourdomain.com/yourdomain.com.key 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy: