2017 m. rugsėjo 1 d., penktadienis

How to Compile Fedoracoin(Tips) Source Code with linux

This tutorial is outdated, you can download fedoracoin linux version here.

Download fedacoin source:
$ cd
$ git clone https://github.com/fedoracoin-dev/fedoracoin
$ cd fedoracoin/

Fedoracoin(Tips) uses the Berkley DB 4.8, we need to download  and install it.
$ TIPS_ROOT=$(pwd) 
$ BDB_PREFIX="${TIPS_ROOT}/db4"
$ mkdir -p $BDB_PREFIX
$ wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
$ tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
$ ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
$ make install

Compile fedoracoin:
$ cd $TIPS_ROOT

Compiling fedoracoind for server use on Ubuntu (Without GUI):
$ ./autogen.sh ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" -without-gui --without-miniupnpc --disable-tests
With GUI, DONT WORK
$ ./autogen.sh
$ ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" --with-gui=qt5

Configure parameters:
--with-gui=qt5 - By default will compile with qt4
CFLAGS  - C compiler flags
LDFLAGS -  linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>*

Make process may take up to 5-10 mins based on your system
$ make
$ make -s -j5 # To use 5 threads for faster compilation


Other compiling option from feathercoin:

$ make clean
$ ./autogen.sh
$ autoupdate
$ ./configure --with-incompatible-bdb
$ qmake -project

$ make

Files can be found:
/usr/local/bin/fedoracoin-cli - Allows you to send RPC commands to bitcoind from the command line. For example, bitcoin-cli help.
/usr/local/bin/fedoracoind - Is more useful for programming: it provides a full peer which you can interact with through RPCs to port 8332 (or 18332 for testnet).
/usr/local/bin/fedoracoind-qt -  Provides a combination full Bitcoin peer and wallet frontend. From the Help menu, you can access a console where you can enter the RPC commands used throughout this document.


Creating .conf file:
$ nano ~/.fedoracoin/fedoracoin.conf
rpcpassword=change_this_to_a_long_random_password
addnode=90.35.187.174
addnode 90.35.187.174

You should also make the .conf file only readable to its owner"
$ chmod 0600 bitcoin.conf

Fixing compilation problems:

Problem:
$ ./autogen.sh 
./autogen.sh: 3: ./autogen.sh: autoreconf: not found
Solution:
$ sudo apt-get install autoconf autogen

Problem:
configure: error: libdb_cxx headers missing S
Solution:
$ sudo apt-get install libdb++-dev

Problem:
Makefile:921: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:675: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:511: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Solution:
Don't use make -s -j5 option when compling from virtual-box

Problem when compiling with QT:
fatal error: QJsonObject: No such file or directory
Solution:
No solution at the moment

Where qt files are located:
~/fedoracoin $ locate qjsonobject.h
/usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonobject.h
 ~/fedoracoin $ locate qprinter.h
/usr/include/qt4/Qt/qprinter.h
/usr/include/qt4/QtGui/qprinter.h
/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/qprinter.h

Dependencies:
$ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler -y

Other dependencies:
$ sudo apt-get install autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libtool -y

2017 m. rugpjūčio 11 d., penktadienis

How to fix pycharm OSError: [Errno 2] No such file or directory

Add fallowing:
$ echo $PATH output from terminal to pycharm environment variables.

2017 m. liepos 18 d., antradienis

How to change pycharm test directory

This solves unitest import errors. Whem pycharm can't find project folder directory or cant import project files.

1. Go to.


2. Add.
PYTHONPATH = /path/to/project/dir


3.Don't forget to save settings:


  • Also might help right clicking on directory, then selecting "Mark directory as" -> Source root

2017 m. liepos 17 d., pirmadienis

IntelliJ IDEA Pycharm naudingi shortcutai

Paieška:
Ctrl+ Shift+ f - Paieška projekte.
Ctrl+ Shift+ a - Paieška galimuose veiksmuose (To Spaces - Performuoja  tab'us į space'us)

Failų navigacija:
Ctrl + Shift + N - Greita indeksuotu failų paieška tarp esamų projektų.
Shift + Shift - Paieška visur.
Ctrl + E - Atidaro langą su failu istorija.

Navigacija:
Shift+Enter - perkelia žymeklį į reikiamą vietą, kodo rašymui.
Ctrl + (Shift) + Tab - Pagrindinio lango išdėstymas.
Ctrl + (Shift) + ↕ - Padidina, sumažina atvaizdavimo/debug langą.


Kortelės:
Shift+Spustėlti - Uždaro kortelės langą.

Informacija apie metodus.
Ctrl + Q - Rodo metodo dokumentaciją.


Paleidimas
Ctrl+Shift+F10 - Paleisti skriptą.

Performatavimas:
Ctrl+Alt+O - Importų optimizacija (Optimize).
Ctrl+Alt+L - Kodo performatavimas.
Ctrl+Alt+V - Petvarko kintamuosius (Variable)


Auto metodų importavimas:
Alt + Enter

Tekstas:
Ctrl+D - Teksto dublikavimas
Ctrl+X - Eilutė panaikinimas.



Automatiškas kabučių dėjimas:
Edittor -> General -> Smart Keys





Sujungia stulpelius į eilutę:
Ctrl + Sfift + J -

2017 m. gegužės 25 d., ketvirtadienis

2017 m. kovo 13 d., pirmadienis

Virtual virtualenv and venv

$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper # Virtualenv programos


# Sukuria virtualia aplinką
$ virtualenv amaze

# Atkivuojam virtualia aplinką
$ . amaze/bin/activate

# Virtualios aplinkos deaktyvavimas
$ deactivate 

# Python3
$ virtualenv -p python3 envname
vim ~/.profile
export WORK_HOME=$HOME/envs # Pasako kur yra virtuali aplinka
export PROJECT_HOME=$HOME/dev # Pasako kur yra python skriptų lokacija /dev
source /usr/local/bin/virtualenvwrapper.sh

. .profile # Užkraunam naują profilį

$ mkdir dev
$ mkproject HelloWorld

$ workon env-pavadinimas # Aplinkos keitimas






venv

$ python3 -m venv my_project/venv # Aplinkos kūrimas
$ source my_project/venv/bin activate # Aplinkos aktyvavimas
$ python -m venv venv --system-site-packages # Aplinka su sistemos paketais