Skip to content

Instantly share code, notes, and snippets.

View mertsalik's full-sized avatar
🏡
WFH only.

Mert Salık mertsalik

🏡
WFH only.
View GitHub Profile
1 : 255,255,255 | 30,215,96
2 : 44,70,185 | 195,239,199
3 : 161,195,211 | 30,50,100
4 : 181,155,201 | 245,231,44
5 : 255,70,50 | 245,231,44
6 : 44,70,185 | 255,100,44
7 : 195,241,185 | 255,255,255
8 : 255,205,211 | 30,50,100
9 : 141,24,50 | 155,241,225
10 : 30,50,100 | 245,114,161

From http://raspberrypi.stackexchange.com/a/312

If you are running Linux then you can use the dd command to make a full backup of the image:

dd if=/dev/diskx of=/path/to/image or for compression:

dd if=/dev/diskx | gzip > /path/to/image.gz Where sdx is your SD card. To restore the backup, you reverse the commands:

rvictl -s <-udid->
// This adds a new virtual network interface xxxxxx.
ifconfig -l
// Get the list of interfaces again, and you can see the xxxxxx
sudo tcpdump -i xxxxxx -w ./output.pcap

// stop
rvictl -x <-udid->

Taken from https://www.cyberciti.biz/open-source/learning-bash-scripting-for-beginners/

  1. BASH Programming – Introduction HOW-TO : This tutorials intends to help you to start programming basic-intermediate shell scripts. It does not intend to be an advanced document.

  2. Advanced Bash-Scripting Guide : An in-depth exploration of the art of shell scripting. A must read to master bash shell scripting for all Unix users.

  3. Learn Bash In Y Minutes : A quick tour of bash programming language.

  4. BASH Frequently Asked Questions : Greg’s Wiki includes answers to many bash programming problems in Q & A format.

import Foundation
class PrinterServiceBrowser: NSObject, NSNetServiceDelegate, NSNetServiceBrowserDelegate {
var services: NSMutableArray!
var serviceBrowser: NSNetServiceBrowser!
var service: NSNetService!
var onFinish: (NSMutableArray -> Void)
init(onFinishBrowsing: NSMutableArray -> Void) {
from PIL import Image
import os
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Make biggest centered square of images in given directory')
parser.add_argument('--dir',
help='Project directory for search image files',
required=True)
import numpy as np
def rgb2ycbcr(rgb_color):
"""
requires numpy
http://www.equasys.de/colorconversion.html
:param rgb_color: tuple(R,G,B)
:return: tuple(Y,Cb,Cr)
"""
if not isinstance(rgb_color, tuple):
raise TypeError("This method only accepts color parameter as tuple!")
[loggers]
keys = root
[handlers]
keys = consoleHandler,fileHandler
[formatters]
keys = fileFormatter,consoleFormatter
[logger_root]
__author__ = 'mertsalik'
CLIENT_ID = "03f40f65049e49b98de691b4cbe710da"
CLIENT_SECRET = "9dd8e1dc8cb54f3c84af8dd4a657f7f7"
REDIRECT_URI = "http://localhost"
TOKEN_URL = "https://api.instagram.com/oauth/authorize/?client_id={clientID}&redirect_uri={redirectURI}&response_type=code"
CURL_COMMAND = "curl -F 'client_id={clientID}' -F 'client_secret={clientSecret}' -F 'grant_type=authorization_code' -F 'redirect_uri={redirectURI}' -F 'code={code}' https://api.instagram.com/oauth/access_token"
if __name__ == "__main__":

Useful mac osx commands i found

networksetup -getairportnetwork en1 | cut -c 24-

Get wireless SSID through shell script