python – eBlog https://emresaglam.com/blog My Blog about my life and my thoughts... Mon, 19 Dec 2016 02:24:43 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 Yaesu FTM-400XDR and Chirp https://emresaglam.com/blog/blog/2016/12/18/yaesu-ftm-400xdr-and-chirp/ https://emresaglam.com/blog/blog/2016/12/18/yaesu-ftm-400xdr-and-chirp/#respond Sun, 18 Dec 2016 21:10:02 +0000 http://emresaglam.com/blog/?p=1174 Continue reading Yaesu FTM-400XDR and Chirp ]]> I use Chirp. I love it. It’s the only way to program my Baofeng UV-R(+) radios… Period.

Also I love that I can download repeater settings according to a zip code, county, state, etc…

I wanted to use Chirp for my Yaesu FTM-400XDR. However it looks like Chirp doesn’t support this model. So my initial reaction was to create the repeater list with Chirp, export on CSV, and import it to Yaesu.

But, that wasn’t possible either since Yaesu expects the data in a different order and format.

I wrote a small python script that rearranges and reformats the CSV file to the expected import file for the Yaesu’s own software. Check out the README to read how you can install and use the script.

By the way, Yaesu’s software to program the radio doesn’t work on Mac OS X natively, since it’s a Windows software. I managed to run it on Mac OS X using wine. But that’s another blog entry…

]]>
https://emresaglam.com/blog/blog/2016/12/18/yaesu-ftm-400xdr-and-chirp/feed/ 0
ý yerine ı görmek istiyor musunuz? https://emresaglam.com/blog/blog/2016/09/16/y-yerine-i-gormek-istiyor-musunuz/ https://emresaglam.com/blog/blog/2016/09/16/y-yerine-i-gormek-istiyor-musunuz/#respond Sat, 17 Sep 2016 03:23:34 +0000 http://emresaglam.com/blog/?p=1152 Türkçe karakterlerin sorunsalı olan ISO-8859-9 formatıyla UTF-8 arasındaki uyuşmazlığı çözen küçük bir python scripti yazdım. Program girdi olarak ISO-8859-9 formatlanmış bir yazı alıyor ve de UTF-8 ile formatlayıp dosyaya yazıyor.

Kullanımı:

python convertToUnicode.py --input /path/to/filename.srt --output /path/to/convertedfilename.srt

ya da

python convertToUnicode.py -i /path/to/filename.srt -o /path/to/convertedfilename.srt

Siz de kullanmak istiyorsanız: https://github.com/emresaglam/convertToUnicode

]]>
https://emresaglam.com/blog/blog/2016/09/16/y-yerine-i-gormek-istiyor-musunuz/feed/ 0
python and resolving ips from a csv file. https://emresaglam.com/blog/blog/2008/03/20/python-and-resolving-ips-from-a-csv-file/ https://emresaglam.com/blog/blog/2008/03/20/python-and-resolving-ips-from-a-csv-file/#respond Thu, 20 Mar 2008 20:48:12 +0000 Continue reading python and resolving ips from a csv file. ]]> Problem: I have a CSV file where I have source and destination IPs. I want to resolve only destination IPs.

Format of my CSV file: (let`s call it test.csv) (it`s tab separated…)

99.88.77.66 11.22.33.44 118340.86 187

The solution is pretty simple with python:

#!/usr/bin/env python
import csv
import socket

reader = csv.reader(open(“./test.csv”, “rb”), delimiter=” “)
for row in reader:
host, aliases, ips = socket.gethostbyaddr(row[1])
print row[0] + ” ” + host + ” ” + row[2] + ” ” + row[3]

First we import the necessary libs. (socket and csv)

Then we open the file to read with as a csv object. (Careful because our delimiter is not comma, but TAB)

for each row we get the second row (row[1]), convert it to host, alias and ip by gethostbyaddr method.

The last line is to create the new tab separated format. (Just pipe it to a file and you have your new CSV file. [tab separated… but oh well..])

Done!

]]>
https://emresaglam.com/blog/blog/2008/03/20/python-and-resolving-ips-from-a-csv-file/feed/ 0