Skip to content

Instantly share code, notes, and snippets.

@hellojukay
hellojukay / exif.py
Created July 28, 2020 02:14
读取照片的 EXIF 信息
#!/bin/python
import glob
import exifread
from dateutil.parser import parse
files = glob.glob("*.JPG")
for file in files:
fh = open(file,"rb")
tags = exifread.process_file(fh)
@hellojukay
hellojukay / ss.pl
Created June 15, 2020 09:29
count tcp connection by process, base on ss command line
use strict;
use warnings;
my @lines = `ss -atp`;
my %hash;
for my $line (@lines) {
if($line =~ /pid=(\d{1,9})/) {
$hash{$1}++;
}
}
@hellojukay
hellojukay / fetch.pl
Last active May 29, 2020 06:55
fetch all github stars
#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request;
use JSON::Parse;
my $ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36");
# if you nedd proxy , don`t foreget it
# $ua->proxy(https => 'http://proxy.exmaple:3128');
# loop all stars util get empty response
package main

func reverse(str string) string {
	if len(str) == 0 || str == " " {
		return str
	}
	index := 0
	for index < len(str) && str[index] != ' ' {
 index = index + 1
package main

func reverse(str string) string {
	if len(str) == 0 || str == " " {
		return str
	}
	index := 0
	for index < len(str) && str[index] != ' ' {
 index = index + 1