ceturtdiena, 2021. gada 23. decembris

Updated

 https://mytechservinginternetmeals.blogspot.com/2021/10/how-to-start-making-browser-video-game.html

more updated -- I'm creating 3d skatepark copy, my work here - https://drive.google.com/file/d/1ubGOpjX6iTFSM6sqyeyg6N8JndwVKoew/view?usp=sharing https://ibb.co/b1HTJtG

https://drive.google.com/file/d/1SaugQ4imeCVrizkRu2vyTaUjzYkUDvkf/view?usp=sharing


https://drive.google.com/file/d/18IAE1ySlamVVxCYy94D5-D2T__V4FqEM/view?usp=sharing
 

raw drafts -- 

pool- 
https://drive.google.com/file/d/1lEvx78VK3EqxbN30GE4vigPb-_SxHs7E/view?usp=sharing
 


FUNBOX - 
https://drive.google.com/file/d/172i1mAB5ZubMw_zN0SsnnQFwUVcKVzLZ/view?usp=sharing


spine - https://drive.google.com/file/d/1qZpKA2ZSYj_atAiK24ACm5l2Xe2n06jY/view?usp=sharing

corner - https://drive.google.com/file/d/1iDa4WUwrPKD8P5ZkjW8mnYPWQkTDXLnk/view?usp=sharing

bank 1 - https://drive.google.com/file/d/1d0IWoOuVrdP92GC9RU6U46cannzH-JgV/view?usp=sharing

bank 2 - https://drive.google.com/file/d/1QJYyIoB_eDm09NOvxnq_MXLLBFyCxM7i/view?usp=sharing

piektdiena, 2021. gada 5. novembris

VIDEO EDITOR CONSOLE. *PSEUDO* CODE. (NOT FINISHED - MIGHT WORK!!)

IF YOU ALWAYS WANTED VIDEO EDITOR THAT JUST TRIMS AND MERGES CLIPS BASED ON CONSOLE INPUT - HERE IS THE C++ VERSION SOURCE CODE.
HOW TO COMPILE? INSTALL g++ AND ffmpeg (CODE IS FOR LINUX SO FAR!!!)
sudo apt install g++
then create new file editor.cpp
compile the file from command line -
g++ -std=c++17 editor.cpp -o editor

copy binary (editor) to /home/ and run the binary ./editor





#include <string>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <algorithm>
#include <unistd.h>

//g++ -std=c++17 editor.cpp -o editor
namespace fs = std::filesystem;
bool in_array(const std::string & value,
  const std::vector < std::string > & array) {
  return std::find(array.begin(), array.end(), value) != array.end();
}
int main() {
//get username 
    std::string Username = getlogin();
//opens file list
  system((std::string("cat /home/") + Username + std::string("/renders/mylist.txt")).c_str());

//asks which folder should program choose
  std::string mape;
  std::cout << "Kura mape?" << "!\n";
  std::cin >> mape;
//asks which file name should final render choose
  std::cout << "Final faila nosaukums? !\n";
  std::string finalnosaukums;
  std::cin >> finalnosaukums;
  std::string path = "/home/" + Username + mape;
  std::vector < std::string > arr;

int guesses = 0;





//counts how many files are in choosed directory
auto dirIter = std::filesystem::directory_iterator(mape);
int fileCount = 0;
for (auto& entry : dirIter)
{
    if (entry.is_regular_file())
    {
        ++fileCount;
    }
}





  for (const auto & entry: fs::directory_iterator(path)) {
    std::string name;
    std::cout << "Kurais video? !\n";
    std::cout << entry.path() << std::endl;
    std::cin >> name;
    if (in_array(name, arr)) {
      //std::cerr << "Found at position " << std::distance(std::array, foo) << endl;
      std::cout << "Kurais video? !\n";
      std::cin >> name;
      std::cout << "Masīva garums. jeb cik video jau pievienoti:" << sizeof(arr) << "!\n";
      std::cout << entry.path() << std::endl;
    } else {
      std::cout << "Not found" << std::endl;
      arr.push_back(name);
    }
    std::cout << entry.path() << name << "!\n";
  }
  for (const auto & entry2: fs::directory_iterator(path)) {
    guesses++;

    std::string name2;
    std::cout << "Kurais video?" << name2 << "!\n";
    std::cout << entry2.path() << std::endl;
    std::cin >> name2;
    if (in_array(name2, arr)) {
      //std::cerr << "Found at position " << std::distance(garumi, foo) << endl;
      std::cout << "Kurais video?" << name2 << "!\n";
      std::cin >> name2;
      //std::cout << "Masīva garums. jeb cik video jau pievienoti:" << size << "!\n";
      std::cout << entry2.path() << std::endl;
    } else {
      std::cout << "Not found" << std::endl;
      if (in_array(name2, arr)) {
        system("ffprobe -i name2 -show_entries format=duration -v quiet -of csv='p=0'");
        int vienav = system("ffprobe -i name2 -show_entries format=duration -v quiet -of csv='p=0'");
        std::cout << "No kuras sekundes sākt? !\n";
        int sakums;
        std::cin >> sakums;
        std::cout << "No kuras sekundes beigt? !\n";
        int beigas;
        std::cin >> beigas;
        if (vienav > beigas) {
          system((std::string("ffmpeg -i name2 -ss") + std::to_string(sakums) + std::string("to") + std::to_string(beigas) + std::string("-c:v libx264 -crf 30 trim_opseek") + name2).c_str());
        } else {
          system("ffprobe -i name2 -show_entries format=duration -v quiet -of csv='p=0'");
          std::cout << "PARSNIEDZI LIMITU ... No kuras sekundes beigt" << beigas << "!\n";
        }
      }
    }
    std::cout << entry2.path() << name2 << "!\n";
  }





if(fileCount === guesses){


  system((std::string("ffmpeg -f concat -safe 0 -i mylist.txt -c copy /home/") + Username + std::string("/renders"), finalnosaukums).c_str());


}


}


svētdiena, 2021. gada 24. oktobris

HOW TO START MAKING BROWSER VIDEO GAME WITH PREMADE GAME CODE? (STARTING POINT FAST, NOT FOR COMPUTER ILLITERATES)

https://drive.google.com/file/d/1Pd3KgXuSVoOFuxyliYjS3RoYb6mvnM28/view?usp=sharing -- THIS IS GAME CLIENT, IT SHOULD BE HOSTED AS ANY WEBSITE, WITH SERVER SETTINGS WHERE (CORS) IS ENABLED. (Apache2 module). To use this, You should be able to install any webserver (python, apache2, nginx etc). SO LINUX KNOWLEDGE IS A MUST MOST LIKELY. 



 THE ORIGINAL GAME CLIENT CODE CAN BE DOWNLOADED HERE - https://github.com/lv88h/Quick_3D_MMORPG 


 ALSO, THERE GAME SERVER CODE, WHICH CAN BE DOWNLOADED HERE (SAME LINK)- https://github.com/lv88h/Quick_3D_MMORPG 



 IN ORDER TO MAKE SERVER WORK, YOU SHOULD BE ABLE TO INSTALL NODE.JS and start the server on 3000 port, by typing in terminal node index.mjs.



 You should be able to close the ports and kill server application afterwards.

sudo netstat -ltup   | open ports
sudo ufw allow 3000/tcp  | open port
lsof -i tcp:3000 | find process on the port
kill -9 PID | kill the process

 More about the way to develop game: Since, this is game based on 3d game engine for web browsers called three.js, You will have to be able to program in javascript, which will be the main point. For example, opening /src/scenerycontroller.js and editing constants that I made to add 3d objects in ordinary coordinates, is a must. 


That's only beginning, since I haven't developed physics to these objects or any other step. Second, once You get basic coding done for physics, You will need a lot of 3d object files in .fbx and .glb files, which can be found in /resources/ folder. 


What You will need to know is 3d design using software like Blender or others. There are animations, which are defined in code and also found in these 3d files, so this is basically, biggest step in this kind of game making. 


 If You have way better way to develop a browser game, or 3d game in general, please contact me @ r.mazitis@gmail.com.

trešdiena, 2021. gada 22. septembris

HOW TO SCREEN RECORD UBUNTU?

If ffmpeg -encoders |grep h264 output NVIDIA HVEC somewhere there, ubuntu uses hardware encoding by default.

ffmpeg -f x11grab -video_size 1920x1080 -framerate 60 -i :1 -v verbose -f pulse -i default -vf format=yuv420p output.mp4



ffmpeg -f x11grab -video_size 1920x1080 -framerate 60 -i :0 -v verbose -f pulse -i default -vf format=yuv420p output.mp4



crtl-c - to finish

otrdiena, 2021. gada 15. jūnijs

Managing LVM Snapshots/ recording desktop on ubuntu / modified pnmixer volume slider for openbox tint2

 https://wiki.learnlinux.tv/index.php/Managing_LVM_Snapshots_on_Arch_Linux

ffmpeg -video_size 1366x768 -framerate 30 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i 0 -c:v libx264rgb -crf 0 -preset ultrafast sample.mkv 


to convert to mp4 - ffmpeg sample.mkv sample.mp4







to modify pnmixer yourself, install glade, download pnmixer from github -  https://github.com/nicklan/pnmixer

the glade GUI will help You modify it, otherwise You can download my modified version from - https://drive.google.com/file/d/1ob19nR7pZL2tfs_wDV3bQscn-WL3Y3Rv/view?usp=sharing

You will need libnotify-dev libasound2-dev


After compiling pnmixer with glade,You copy binary and add script that uses files located on Downloads folder (where You stored unarchieve pnmixer-master)

echo -e '#!/bin/bash\ncd ~/Downloads/pnmixer-master/build/ && ./src/pnmixer && cd' | sudo tee /usr/bin/pmx && sudo chmod +x /usr/bin/pmx


create system wide shortcut -  sudo geany ~/.local/share/applications/pmx.desktop 


[Desktop Entry]
NotShowIn=Unity;GNOME;
Name=Files
Comment=Access and organize files
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=volume slider;
Exec=pmx
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Nautilus
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;Core;
X-GNOME-UsesNotifications=true
Actions=new-window;
X-Unity-IconBackgroundColor=#af4853
X-Ubuntu-Gettext-Domain=nautilus

X-AppStream-Ignore=true

[Desktop Action new-window]
Name=New Window
Exec=pmx






Add shortcut to Tint2 
sudo geany ~/.config/tint2/tint2rc 

 launcher_item_app = pmx.desktop

pirmdiena, 2021. gada 14. jūnijs

Make Nautilus 3.26.4 for ubuntu 18.04 log copy/move/delete/rename actions. (UPDATED SECOND TIME) HIGHLY EXPERIMENTAL

I PERSONALLY THINK VANILLA VERSION ON UBUNTU IS FAILURE SO THIS ARTICLE DOES NOT MAKE A SENSE UNTIL OPENSOURCE COMMUNITY FIXES NAUTILUS ITSELF ON ANY DISTRO, BUT CMMON.




First of all, this Nautilus version will use Vanilla theme. (Might fix the styling issues for ubuntu 18.04 later.) Second of all, it does not log location of files that are renamed using it. Third of all, logged files have missing extensions. (So far these are only bugs there is to this code). So while using this version, I take no responsibility over it's doings as it is simply few lines of code added to few functions - IN NUTSHELL - https://paste.ubuntu.com/p/PvpBM6dMw5/

Link to flatpak file (org.gnome.NautilusDevel.flatpak)- 

https://drive.google.com/file/d/1sgXckMoXQmfm38nEfqWJ-k0OGDH17Tiv/view?usp=sharing


TO RUN YOUR NAUTILUS FLATPAK OR BUILD IT BY GNOME-BUILDER YOU NEED TO INSTALL FLATPAK ETC but ONCE YOU HAVE BUILDER INSTALLED WITH WORKING BUILDED APP YOU CAN GET APPLICATION THAT DOES NOT NEED FLATPAK - https://stackoverflow.com/questions/60800783/can-gnome-builder-actually-produce-something-else-than-flatpaks

sudo apt install flatpak

flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo

flatpak install flathub org.gnome.Platform//3.28\

sudo flatpak --user install org.gnome.NautilusDevel.flatpak






TO REMOVE FLATHUB - flatpak remote-delete flathub

IF EVERYTHING GOES WRONG:

flatpak uninstall --unused

sudo apt-get remove --autoremove flatpak

sudo apt-get purge flatpak
sudo rm -rf /var/lib/flatpak $HOME/.local/share/flatpak



To run Your Nautilus flatpak - flatpak run org.gnome.NautilusDevel . Log files are saved under /home/username/ directory.

Remember, this is flatpak and it will not replace original system wide used Nautilus, SO after doing this, original system wide used Nautilus, will still not have these features, but they will be USABLE ONLY FROM flatpak version.

In case You want to compile, follow article (There are some tips on creating system wide shortcuts at the end of it, and running Your flatpak Nautilus - >



 For logging copy/move/delete functionality, here is the  - nautilus-file-operations.c   file -  https://paste.ubuntu.com/p/kRhQFtZj4Q/

For logging renaming - here is the - nautilus-files-view.c file -

https://paste.ubuntu.com/p/PxwnBRQYmR/

(logging renaming does not include location of where files are renamed, or which ones are renamed)

Install gnome-builder - (don't run as root)

 flatpak install --user --from https://flathub.org/repo/appstream/org.gnome.Builder.flatpakref
 flatpak run --user org.gnome.Builder Install gnome-builder -

Run gnome-builder -

flatpak run org.gnome.Builder -vvvv

Select Nautilus and choose this repository - 

VANILLA VERSION - 

https://gitlab.gnome.org/chrism/nautilus.git

UBUNTU VERSION - 

https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/nautilus


Modify nautilus-file-operations.c and nautilus-files-view.c  in source file directory (src).


Build and Export bundle.
 sudo apt install gnome-software-plugin-flatpak


 sudo flatpak install org.gnome.NautilusDevel.flatpak





to run Your version of nautilus with flatpak - flatpak run org.gnome.NautilusDevel 









create system wide shortcut -  sudo geany ~/.local/share/applications/NEWNAUTILUS.desktop 


[Desktop Entry]
NotShowIn=Unity;GNOME;
Name=Files
Comment=Access and organize files
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=folder;manager;explore;disk;filesystem;
Exec=flatpak run org.gnome.NautilusDevel 
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Nautilus
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;Core;FileManager;
X-GNOME-UsesNotifications=true
Actions=new-window;
X-Unity-IconBackgroundColor=#af4853
X-Ubuntu-Gettext-Domain=nautilus

X-AppStream-Ignore=true

[Desktop Action new-window]
Name=New Window
Exec=nautilus --new-window



Add shortcut to Tint2 
sudo geany ~/.config/tint2/tint2rc 

 launcher_item_app = NEWNAUTILUS.desktop

svētdiena, 2021. gada 13. jūnijs

HOW TO GREP ON WINDOWS / favorite wallpaper

If  You use command line You might want to know following commands using linux:


cd / ls (dir in windows) / pwd / uname -a / cp / rm / rmdir / chmod / chown / find


but one of the crazy features and all time needed features is searching text in files recursively (scanning through all the subfolders), and for linux it is grep -r "text you want to find". 

windows on other hand:

findstr /s /i STRING *.*

get-childitem -recurse FILENAME


this article is not going to be long or explanatory, but if You research these basic commands and learn how to use them while doing You computer tasks, You be upgrading Your intelligence and skill set, 

what I suggest is also, learning how to: compile c and c++ program's on linux and windows, learning to compile python, write html and php, JAVASCRIPT, learn some bash/cmd scripts

and overall, check my github account github.com/lv88h - projects like https://github.com/lv88h/GOING_DOWN_THE_RABBIT_HOLE_IN_PHP explain the algorithm that draws pixels in images on screen from such data types as arrays.

https://github.com/lv88h/game-controller - shows an example of how game controller or any controller might be written in code (in this following example the code is in javascript). 


How to open command line TTY if Ubuntu has been stuck to kill guilty processes? HOW TO START PC IN RECOVERY OR BIOS?

ESCAPE OR SHIFT WHILE STARTING - MORE ABOUT RECOVERY (https://www.maketecheasier.com/boot-recovery-mode-ubuntu/)


F2 FOR BIOS. 


You can get to tty3 by pressing Ctrl+Alt+F3, tty4 by pressing Ctrl+Alt+F4, tty5 by pressing Ctrl+Alt+F5 and tty6 by pressing Ctrl+Alt+F6.

You can then switch between tty3-6 by pressing Alt with the appropriate F-key.


Login with Your current username and password. Commands like killall geany, killall google-chrome, will likely kill the process. Also You can use htop. Inside htop, search for process name You wanna kill by F4, then press F9, press 9 (sigkill) and ENTER.



Finally, you can get back to the GUI with Alt+F1 for the login chooser or Alt+F2 for the logged-in user's desktop.


IF THE GUI been stuck try Ctrl+Alt+Backspace


  • Alt+SysRq+E send SIGTERM (termination) signal to all processes except mother init

sestdiena, 2021. gada 12. jūnijs

Install ubuntu 18.04

https://phoenixnap.com/kb/how-to-install-ubuntu-18-04

https://www.linuxtechi.com/ubuntu-18-04-lts-desktop-installation-guide-screenshots/


Create bootable Ubuntu USB stick

 https://ubuntu.com/tutorials/create-a-usb-stick-on-windows - windows        

create startup disk on ubuntu.

How to install openbox on ubuntu 18.04

sudo apt install openbox
 sudo apt install openbox-gnome-session 
sudo apt install xcompmgr 
sudo apt install gnome-screensaver
 sudo apt install obmenu

add apps with commands like pavucontrol, kill tint2, tint2 etc you want

 sudo apt install pavucontrol 
 sudo apt install tint2
sudo apt install feh

feh --bg-scale /home/ronalds/Pictures/pexels-photo-1260820.jpeg
 sudo geany /etc/xdg/openbox/autostart.sh 
add:
eval `cat $HOME/.fehbg` &
tint2 &


 sudo nautilus /usr/share/applications
 sudo geany ~/.local/share/applications/lockscg.desktop 

[Desktop Entry] Type=Application Name=lock screen Exec=gnome-screensaver-command -l 


sudo geany ~/.local/share/applications/show-desktop.desktop 

[Desktop Entry] Type=Application Name=Show Desktop Icon=desktop Exec=xdotool key --clearmodifiers Super+d 


sudo geany ~/.config/tint2/tint2rc 

add:

 launcher_item_app = show-desktop.desktop
 launcher_item_app = nautilus.desktop 
launcher_item_app = gnome-terminal.desktop
 launcher_item_app = pavucontrol.desktop
 launcher_item_app = google-chrome.desktop
 launcher_item_app = lockscg.desktop


DON't forget to switch off going to hibernation on closing the lid, in the gnome-desktop-environment, if You don't really like Your laptop doing that in Openbox session.