Skip to content

Instantly share code, notes, and snippets.

View lucassm's full-sized avatar
💭
Eletric Power systems, Python and IT

Lucas Melo lucassm

💭
Eletric Power systems, Python and IT
View GitHub Profile
@andreibosco
andreibosco / cpntools_macos.md
Last active August 21, 2022 22:34
running CPNtools 4.0.1 on MacOS

Running CPN Tools on MacOS Mojave

Based on the linux (Ubuntu) instructions by Sebastiaan J. (Bas) van Zelst available at https://www.win.tue.nl/~svzelst/misc/

  1. Download CPN Tools (for windows) from: http://cpntools.org/download
  2. Install wine: brew install wine
  3. Install CPN Tools using wine and make sure to include the MacOS simulator: wine cpntools_4.0.1.exe
  4. If this does not work due to a missing java version, download OpenJDK JRE installer from https://adoptopenjdk.net/
    • Remember that you have to download the Windows version and install it using wine
    • To install the .msi version, use wine start $installer, replacing $installer with the actual filename
  5. Download this bash script and place it in: ~/.wine/drive_c/Program Files (x86)/CPN Tools (or wherever you installed CPN Tools)
#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <string.h>
#include <string>
using namespace std;
@samklr
samklr / ipython-nbserver.py
Last active March 26, 2020 21:52
Install Ipython Notebook on a VM and Launch it as a server in a Cloud Platform. Here, in Google Compute Engine.
##### Install a lot of stuff first #####
$sudo apt-get update
##install python
$ wget http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.0.1-Linux-x86_64.sh
$ sudo bash anaconda........sh
##install necessary libs
$ sudo apt-get install -y python-matplotlib python-tornado ipython ipython-notebook python-setuptools python-pip
@ederwander
ederwander / gist:1342497
Created November 6, 2011 05:01
Accessing the Google Speech API + Python
# Copyright (c) 2011, Eng Eder de Souza
# ___ _ _ ___
# | __|__| |___ _ _ __| |___ / __| ___ _ _ _____ _
# | _|/ _` / -_) '_| / _` / -_) \__ \/ _ \ || |_ / _` |
# |___\__,_\___|_| \__,_\___| |___/\___/\_,_/__\__,_|
#Accessing the Google API for speech recognition!
#Open a file type Wav to speech recognition
#This source does not require any external programs to perform audio conversions :-)
#http://ederwander.wordpress.com/2011/11/06/accessing-the-google-speech-api-python/
#Eng Eder de Souza