Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
ericoporto / firstsnapexperience.md
Last active December 6, 2017 22:37
Trying to build a Snap for the first time

#My Notes on My First Snap Building Experience

Hi, I wanted to try building a Snap package, so from my experiment thought on leave what my wandering left me, lot's of this content is from the Ubuntu Desktop Developer website . The website has a nice getting started too! .

@ericoporto
ericoporto / getmelogs.sh
Created May 15, 2016 15:45
Get logs and anonimize them to send to someone friendly.
#!/bin/bash
grep --recursive "error" /var/log/ 2>&1 | sed "s/$HOSTNAME/HoStNaMe/g" | sed "s/$USER/uSeRnAmE/g" > ~/allerrors.log
@ericoporto
ericoporto / pyqtUbuntuMime.md
Created June 17, 2016 23:22
How to open a file from Nautilus (in Ubuntu) with your PyQt app

I created a file mymime.xml

<?xml version='1.0' encoding='utf-8'?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="text/myapp">
        <comment>my format</comment>
        <glob pattern="*.myformat"/>
    </mime-type>
</mime-info>
@ericoporto
ericoporto / forkMyself.md
Last active July 17, 2017 13:00
How to fork my own github repository.
  1. create a new repository in Github, don't add a readme or anything.

  2. clone it on your computer

  3. add the original repository (the one you want to fork) as upstream source.

    git remote add upstream [url]

  4. fetch and merge upstream.

@ericoporto
ericoporto / AsusEEEPC701Lubuntu.md
Created June 19, 2016 18:28
A writing on booting Lubuntu 16.04 on ASUS EEEPC 701 with nonpae cpu

I have an old Asus EEE PC 701 (4GB SSD 2GB RAM) with Crunchbang and since Crunchbang development stopped, decided to try Lubuntu in it. So I made a Lubuntu 16.04 i386 bootable flash using unetbootin and a 8GB pen drive under Ubuntu.

At the system start, selecting the option Try Lubuntu without installing gives me a non-pae cpu error. Using tab I see that this option is made like this.

/casper/vmlinuz initrd=/casper/initrd.lz file=/cdrom/preseed/lubuntu.seed boot=casper quiet splash --- persistent 

So I try forcepae option to boot. This will boot, but error on [ OK ] Started Update UTMP about System Runlevel Changes. To fix, we need to boot twice, first let's add nomodeset.

/casper/vmlinuz initrd=/casper/initrd.lz file=/cdrom/preseed/lubuntu.seed boot=casper quiet splash nomodeset forcepae -- forcepae --- persistent 
@ericoporto
ericoporto / note.md
Last active October 10, 2016 21:23
Just to remember how to make releases to PyPI

FIX THE VERSION IN THE CODE

#taging to later create release
git tag 0.1.0 -m "My first tag."
git push --tags origin master

#submit to tests
python3 setup.py register -r pypitest
python3 setup.py sdist upload -r pypitest
@ericoporto
ericoporto / check_newest.py
Created August 28, 2016 23:19
how to check if version is latest
from distutils.version import StrictVersion
from fgmk import __version__
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
def is_this_newest():
try:
pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
@ericoporto
ericoporto / tagandpypi.sh
Last active September 15, 2016 00:21
Use `tagandpypi.sh 'tag message'` to create a tag for current version and send the result to pypi (uses Twine to preven MITM)
#!/bin/bash
MESSAGE=$1
VERSION=`grep __version__ */__init__.py | cut -d= -f2 | tr -d '[[:space:]]'`
git tag $VERSION -m $MESSAGE
git push --tags origin master
python3 setup.py sdist
LATESTDIST=`ls -td dist/* | head -1`
twine register $LATESTDIST
twine upload dist/*
@ericoporto
ericoporto / img.md
Created September 24, 2016 21:21
Image holder

This is just to hold images

@ericoporto
ericoporto / ags_learningnotes.md
Last active July 5, 2017 03:23
My notes while learning to use Adventure Game Studio

Simple struct declaration

struct Pos {
 int x;
 int y;
}

Pos initialPosition;

Pos importantPosition[3];