...kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO...
# xfs_repair -L /dev/mapper/fedora-root
# xfs_repair -L /dev/mapper/fedora-swap
# reboot
This will fix this error.
tutorials, tips, tricks, commands, programming, linux, windows, database, sql, python, programming language, Fedora, drawing, painting, tutorial, tutorials
# xfs_repair -L /dev/mapper/fedora-root
# xfs_repair -L /dev/mapper/fedora-swap
# reboot
This will fix this error.
[root@desk mythcat]# dnf install SDL2-devel.x86_64
[root@desk mythcat]# dnf install SDL2_ttf-devel.x86_64
[root@desk mythcat]# dnf install SDL2_image-devel.x86_64
[mythcat@desk ~]$ go get github.com/felixangell/strife
[mythcat@desk ~]$ cd $GOPATH/src/github.com/felixangell/strife
I test one example from installation folder with particles:[mythcat@desk strife]$ cd example/particles
[mythcat@desk particles]$ go run particles.go
2018/10/04 22:13:18 initializing window 1280 x 720
2018/10/04 22:13:18 dpi, default_dpi = 0 72
2018/10/04 22:13:21 Loading font /usr/share/fonts/DejaVuSans.ttf
2018/10/04 22:13:21 Failed to load font at '/usr/share/fonts/DejaVuSans.ttf'
' try setting a font yourself with strife.LoadFont
resize to 1280 x 960
resize to 1280 x 960
resize to 1280 x 720
resize to 1280 x 720
closing window!
This is result of the running example:
[mythcat@desk ~]$ pip install Nikola --user
Collecting Nikola
...
Installing collected packages: Nikola
Successfully installed Nikola-7.8.15
[mythcat@desk ~]$ nikola init mysite
[2018-10-01T14:09:02Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:09:02Z] WARNING: bundles: Setting USE_BUNDLES to False.
Creating Nikola Site
====================
This is Nikola v7.8.15. We will now ask you a few easy questions about your new site.
If you do not want to answer and want to go with the defaults instead, simply restart with the `-q` parameter.
--- Questions about the site ---
Site title [My Nikola Site]: my_website
Site author [Nikola Tesla]: catafest
Site author's e-mail [n.tesla@example.com]: catafest@yahoo.com
Site description [This is a demo site for Nikola.]: website with Nikola static sit
Site URL [https://example.com/]: http://example.com
The URL does not end in '/' -- adding it.
Enable pretty URLs (/page/ instead of /page.html) that don't need web server configuration? [Y/n] y
--- Questions about languages and locales ---
We will now ask you to provide the list of languages you want to use.
Please list all the desired languages, comma-separated, using ISO 639-1 codes.
The first language will be used as the default.
Type '?' (a question mark, sans quotes) to list available languages.
Language(s) to use [en]: en
Please choose the correct time zone for your blog. Nikola uses the tz database.
You can find your time zone here:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Time zone [Europe/Bucharest]:
Current time in Europe/Bucharest: 17:12:36
Use this time zone? [Y/n] y
--- Questions about comments ---
You can configure comments now. Type '?' (a question mark, sans quotes) to list available comment systems.
If you do not want any comments, just leave the field blank.
Comment system:
That's it, Nikola is now configured. Make sure to edit conf.py to your liking.
If you are looking for themes and addons, check out https://themes.getnikola.com/ and https://plugins.getnikola.com/.
Have fun!
[2018-10-01T14:12:54Z] INFO: init: Created empty site at mysite.
Now you can build and start the server with this command:[mythcat@desk ~]$ cd mysite/
[mythcat@desk mysite]$ ls
cache conf.py conf.pyc files galleries listings pages posts
[mythcat@desk mysite]$ nikola build
[2018-10-01T14:14:51Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:14:51Z] WARNING: bundles: Setting USE_BUNDLES to False.
Scanning posts........done!
. render_posts:timeline_changes
...
[2018-10-01T14:14:52Z] WARNING: Nikola: Python 2 is old and busted. Python 3 is the new hotness.
[2018-10-01T14:14:52Z] WARNING: Nikola: Nikola is going to deprecate Python 2 support in 2017. You already have Python 3
available in your system. Why not switch?
Please check http://bit.ly/1FKEsiX for details.
. sitemap:output/sitemap.xml
. sitemap:output/sitemapindex.xml
. robots_file:output/robots.txt
[mythcat@desk mysite]$ nikola serve -b
Let's see the result of this running server: [mythcat@desk mysite]$ nikola new_post
[2018-10-01T14:16:09Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:16:09Z] WARNING: bundles: Setting USE_BUNDLES to False.
Creating New Post
-----------------
Title: New post
Scanning posts........done!
[2018-10-01T14:16:24Z] INFO: new_post: Your post's text is at: posts/new-post.rst
[mythcat@desk mysite]$ nikola build
[2018-10-01T14:16:34Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:16:34Z] WARNING: bundles: Setting USE_BUNDLES to False.
Scanning posts........done!
. render_posts:timeline_changes
The result will be this:[mythcat@desk mysite]$ nikola theme -l
[2018-10-01T14:21:20Z] WARNING: Nikola: In order to USE_BUNDLES, you must install the "webassets" Python package.
[2018-10-01T14:21:20Z] WARNING: bundles: Setting USE_BUNDLES to False.
Available Themes:
-----------------
blogtxt
bnw
bootblog
bootblog-jinja
bootstrap
bootstrap-jinja
bootstrap3-gradients
bootstrap3-gradients-jinja
cadair
canterville
carpet
detox
foundation6
hack
hemingway
hpstr
hyde
jidn
lanyon
libretto
lotabout
material-theme
maupassant
mdl
monospace
oldfashioned
planetoid
readable
reveal
reveal-jinja
slidemenu
srcco.de
yesplease
zen
zen-forkawesome
zen-ipython
zen-jinja
[mythcat@desk django]$ source bin/activate
I install this python module named django-tinymce:(django) [mythcat@desk django]$ pip install django-tinymce4-lite
Collecting django-tinymce4-lite
...
Installing collected packages: jsmin, django-tinymce4-lite
Successfully installed django-tinymce4-lite-1.7.2 jsmin-2.2.2
Let's see my folder project django named src:(django) [mythcat@desk django]$ cd src/
(django) [mythcat@desk src]$ ll
total 136
-rw-r--r--. 1 mythcat mythcat 135168 Sep 28 12:21 db.sqlite3
-rwxrwxr-x. 1 mythcat mythcat 541 Sep 23 18:56 manage.py
drwxrwxr-x. 4 mythcat mythcat 142 Sep 26 21:45 pages
drwxrwxr-x. 4 mythcat mythcat 142 Sep 28 18:30 products
drwxrwxr-x. 3 mythcat mythcat 112 Sep 28 12:04 templates
drwxrwxr-x. 3 mythcat mythcat 93 Sep 28 12:14 trydjango
The installation is simple and star with to your settings.py and url.py file:(django) [mythcat@desk src]$ cd trydjango/
(django) [mythcat@desk trydjango]$ vim settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'products',
'tinymce',
]
(django) [mythcat@desk trydjango]$ vim urls.py
from django.contrib import admin
from django.urls import path, include
from pages.views import home_view, about_view, contact_view
from products.views import product_detail_view
urlpatterns = [
path('', home_view, name='home'),
path('about/', about_view),
path('contact/',contact_view),
path('admin/',admin.site.urls),
path('product/',product_detail_view),
path(r'^tinymce/', include('tinymce.urls')),
This is my change I used to add the tinymce editor into my django application named products.(django) [mythcat@desk products]$ vim models.py
from django.db import models
from tinymce.models import HTMLField
# Create your models here.
class Product(models.Model):
title = models.CharField(max_length=120)
# description = models.TextField(blank=True, null=True)
description = HTMLField()
price = models.DecimalField(decimal_places=2, max_digits=1000)
summary = models.TextField(default='this is cool!')
You can see I used HTMLField and default come is TextField.[mythcat@desk system]# cd /etc/systemd/system/
[root@desk system]# vim testpython.service
This file is a configuration file for this service.
[Unit]
Description=Python Service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python /home/mythcat/test_service.py
[Install]
WantedBy=multi-user.target
Create the python file for this service. I named test_service.py .
[root@desk system]# exit
exit
[mythcat@desk system]$ cd ~
[mythcat@desk ~]$ vim test_service.py
#!/usr/bin/env python
import logging
import time
logging.basicConfig(level="INFO")
while True:
logging.info("Hi")
time.sleep(3)
Change permissions file for this python file and testpython.service, see:
[mythcat@desk ~]$ chmod 764 test_service.py
Because you run this service with systemd then selinux will send you error, fix that:
[mythcat@desk ~]$ chcon -t bin_t ~/test_service.py
Reload all services and start your service with this commands:
[root@desk system]# systemctl daemon-reload
[root@desk system]# systemctl start testpython.service
[root@desk system]# systemctl status testpython.service
● testpython.service - Python Service
Loaded: loaded (/etc/systemd/system/testpython.service; enabled; vendor>
Active: active (running) since Sat 2018-09-22 21:36:23 EEST; 5s ago
Main PID: 7213 (python)
Tasks: 1 (limit: 2102)
Memory: 5.7M
CGroup: /system.slice/testpython.service
└─7213 /usr/bin/python /home/mythcat/test_service.py
Sep 22 21:36:23 desk systemd[1]: Started Python Service.
Sep 22 21:36:24 desk python[7213]: INFO:root:Hi
Sep 22 21:36:27 desk python[7213]: INFO:root:Hi
You can use the journalctl command to see the output of this service:
[root@desk system]# journalctl -u testpython.service
-- Logs begin at Sat 2018-09-22 20:40:06 EEST, end at Sat 2018-09-22 21:31:07 EEST. --
Sep 22 20:40:06 desk python[6232]: INFO:root:Hi
Sep 22 20:40:09 desk python[6232]: INFO:root:Hi
Sep 22 20:40:12 desk python[6232]: INFO:root:Hi
Sep 22 20:40:15 desk python[6232]: INFO:root:Hi
Sep 22 20:40:18 desk python[6232]: INFO:root:Hi
Sep 22 20:40:21 desk python[6232]: INFO:root:Hi
Sep 22 20:40:24 desk python[6232]: INFO:root:Hi
Sep 22 20:40:27 desk python[6232]: INFO:root:Hi
Sep 22 20:40:30 desk python[6232]: INFO:root:Hi
Let's see the result:[root@desk mythcat]# npm i --global @adonisjs/cli
/usr/bin/adonis -> /usr/lib/node_modules/@adonisjs/cli/index.js
...
+ @adonisjs/cli@4.0.7
added 406 packages from 182 contributors in 33.533s
Go to the default user:[root@desk mythcat]# exit
exit
Create the application , I named myapp:[mythcat@desk ~]$ adonis new myapp
_ _ _ _
/ \ __| | ___ _ __ (_)___ | |___
/ _ \ / _` |/ _ \| '_ \| / __|_ | / __|
/ ___ \ (_| | (_) | | | | \__ \ |_| \__ \
/_/ \_\__,_|\___/|_| |_|_|___/\___/|___/
[1/6] 🔬 Requirements matched [node & npm]
[2/6] 🔦 Ensuring project directory is clean [myapp]
[3/6] 📥 Cloned [adonisjs/adonis-fullstack-app]
[4/6] 📦 Dependencies installed
[5/6] 📖 Environment variables copied [.env]
[6/6] 🔑 Key generated [adonis key:generate]
🚀 Successfully created project
👉 Get started with the following commands
Let's test the default myapp with this commands:$ cd myapp
$ adonis serve --dev
[mythcat@desk ~]$ cd myapp
[mythcat@desk myapp]$ adonis serve --dev
SERVER STARTED
> Watching files for changes...
2018-09-16T09:47:46.799Z - info: serving app on http://127.0.0.1:3333
This is the result of the running myapp on 127.0.0.1:3333 web address: [mythcat@desk myapp]$ ls
ace config node_modules package-lock.json README.md server.js
app database package.json public resources start
The configuration for web files can be seen here:[mythcat@desk myapp]$ vim start/routes.js
'use strict'
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Http routes are entry points to your web application. You can create
| routes for different URL's and bind Controller actions to them.
|
| A complete guide on routing is available here.
| http://adonisjs.com/docs/4.1/routing
|
*/
/** @type {import('@adonisjs/framework/src/Route/Manager'} */
const Route = use('Route')
Route.on('/').render('welcome')
~
This is telling Adonis that when the root of the site is loaded, render a template/view called welcome.[mythcat@desk myapp]$ cd resources/
[mythcat@desk resources]$ ll
total 0
drwxrwxr-x. 2 mythcat mythcat 26 Sep 16 12:46 views
[mythcat@desk resources]$ cd views/
[mythcat@desk views]$ ll
total 4
-rw-rw-r--. 1 mythcat mythcat 339 Sep 16 12:46 welcome.edge
Let's see the source code of this default webpage:[mythcat@desk views]$ vim welcome.edge
...
For example, if you change into start/routes.js from welcome to index then you need to rename the welcome.edge to index.edge .[mythcat@desk myapp]$ cd public/
[mythcat@desk public]$ vim style.css
@import url('https://fonts.googleapis.com/css?family=Montserrat:300');
html, body {
height: 100%;
width: 100%;
}
body {
font-family: 'Montserrat', sans-serif;
font-weight: 300;
background-image: url("/splash.png");
background-color: #220052;
}
* {
margin: 0;
padding: 0;
}
...
Using the mysql database is simple. Into Fedora 28 distro you can use mariadb, let's install it.[mythcat@desk myapp]$ su
Password:
[root@desk myapp]# dnf install mariadb mariadb-server
...
Complete!
[root@desk myapp]# systemctl start mariadb
[root@desk myapp]# systemctl status mariadb
● mariadb.service - MariaDB 10.2 database server
...
You need to make changes into .env file into your project folder.[mythcat@desk myapp]$ vim .env
HOST=127.0.0.1
PORT=3333
NODE_ENV=development
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=xxxxxxxxxxxxxxxx
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_DATABASE=adonis
SESSION_DRIVER=cookie
HASH_DRIVER=bcrypt
~
Use this changes for mariadb:DB_CONNECTION=mysql
Install into AdonisJs with this command:[mythcat@desk myapp]$ adonis install mysql
[1/1] 📦 Dependencies installed [mysql]
Use this mysql commands to create the database:[mythcat@desk myapp]$ mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.2.17-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database adonis;
Query OK, 1 row affected (0.11 sec)
MariaDB [(none)]> exit;
Bye
Let's test migration command for files to allow you to create and delete tables.[mythcat@desk myapp]$ adonis migration:run
migrate: 1503248427885_user.js
migrate: 1503248427886_token.js
Database migrated successfully in 4.11 s
[mythcat@desk myapp]$ adonis make:migration jobs
> Choose an action undefined
✔ create database/migrations/1537095058367_jobs_schema.js
Now that our database and tables have been created, I can create a model for handling jobs table and associated data.[mythcat@desk ~]$ mkdir ~/gocode
[mythcat@desk ~]$ export GOPATH=~/gocode
[mythcat@desk ~]$ echo export GOPATH=$GOPATH >> ~/.bash_profile
[mythcat@desk ~]$ cd gocode/
[mythcat@desk gocode]$ go get github.com/revel/revel
[mythcat@desk gocode]$ ls
pkg src
[mythcat@desk gocode]$ go get github.com/revel/cmd/revel
[mythcat@desk gocode]$ ls
bin pkg src
[mythcat@desk gocode]$ export PATH="$PATH:$GOPATH/bin"
[mythcat@desk gocode]$ revel helpDEBUG 19:24:09 revel server.go:27: arguments by adding nil
~
~ revel! http://revel.github.io
~
usage: revel command [arguments]
The commands are:
new create a skeleton Revel application
run run a Revel application
build build a Revel application (e.g. for deployment)
package package a Revel application (e.g. for deployment)
clean clean a Revel application's temp files
test run all tests from the command-line
version displays the Revel Framework and Go version
Use "revel help [command]" for more information.
[mythcat@desk gocode]$ ls
bin pkg src
[mythcat@desk gocode]$ revel new myapp
DEBUG 19:38:50 revel server.go:27: RegisterServerEngine: Registered engine
~
~ revel! http://revel.github.io
~
Your application is ready:
/home/mythcat/gocode/src/myapp
You can run it with:
revel run myapp
[mythcat@desk gocode]$ revel run myapp
DEBUG 19:39:15 revel server.go:27: RegisterServerEngine: Registered engine
~
~ revel! http://revel.github.io
~
Trying to build with myapp (0x0,0x0)
DEBUG 19:39:15 revel module.go:152: Sorted keys section=module keys=module.static
...
Let's see the source code - in this case the default files: app.go and Index.html .[mythcat@desk gocode]$ cd src/myapp/app/
[mythcat@desk app]$ ls
controllers init.go routes tmp views
[mythcat@desk app]$ cd controllers/
[mythcat@desk controllers]$ ls
app.go
[mythcat@desk controllers]$ cat app.go
package controllers
import (
"github.com/revel/revel"
)
type App struct {
*revel.Controller
}
func (c App) Index() revel.Result {
return c.Render()
}
[mythcat@desk App]$ cat Index.html
The cat command will show the source code of Index.html file.[mythcat@desk controllers]$ cat app.go
package controllers
import (
"github.com/revel/revel"
)
type App struct {
*revel.Controller
}
func (c App) Index() revel.Result {
greeting := "Fedora and revel framework !"
return c.Render(greeting)
}
This variable greeting will will be add into file Index.html with tag p after It works![mythcat@desk Godot_test_001]$ ll
total 41752
-rw-rw-r--. 1 mythcat mythcat 41092 Aug 2 18:34 Godot_test_001.pck
-rwxrwxr-x. 1 mythcat mythcat 42707653 Aug 2 18:34 Godot_test_001.x86_64
[mythcat@desk Godot_test_001]$ ./Godot_test_001.x86_64
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) Ivybridge Desktop
Mono: Initializing module...
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/lib/mono/4.5/mscorlib.dll' directory.
The error occurred from the mono package and I fixed it with the installation using the dnf tool.
[root@desk mythcat]# dnf install mono-core.x86_64
Last metadata expiration check: 1:22:05 ago on Thu 02 Aug 2018 05:30:05 PM EEST.
Dependencies resolved.
...
Installed:
mono-core.x86_64 4.8.0-14.fc28 libgdiplus.x86_64 5.6-1.fc28
mono-data.x86_64 4.8.0-14.fc28 mono-data-sqlite.x86_64 4.8.0-14.fc28
mono-extras.x86_64 4.8.0-14.fc28 mono-mvc.x86_64 4.8.0-14.fc28
mono-wcf.x86_64 4.8.0-14.fc28 mono-web.x86_64 4.8.0-14.fc28
mono-winforms.x86_64 4.8.0-14.fc28
Complete!
Here's the final result:
[mythcat@desk Godot_test_001]$ ./Godot_test_001.x86_64
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) Ivybridge Desktop
Mono: Initializing module...
Mono: Runtime initialized
Mono: INITIALIZED