Sunday, February 3, 2019

Backup home directory

duplicity --no-encryption --progress -vi --include-filelist incl_filelist.txt --exclude '/home/yur' /home/yur file://./home_yur
date -Isec


incl_filelist.txt:
/home/yur/.config
/home/yur/Desktop
/home/yur/Documents
/home/yur/.dosbox
/home/yur/Downloads
/home/yur/.gitconfig
/home/yur/.hgrc
/home/yur/.local
/home/yur/local_inst
/home/yur/local_src
/home/yur/.mozilla
/home/yur/.mpv
/home/yur/my_projects
/home/yur/myvim.vim
/home/yur/.nbi
/home/yur/.netbeans
/home/yur/.ssh
/home/yur/.vim
/home/yur/.vimrc
/home/yur/.vscode

Saturday, November 17, 2018

G-Pen 560 in 2018, manjaro linux

cat /usr/share/X11/xorg.conf.d/70-aiptekmy.conf

Section "InputClass"                                                          
    Identifier "pen"                                                          
    MatchProduct "Aiptek|AIPTEK|aiptek"                                       
    MatchDevicePath "/dev/input/event*"                                       
    Driver "evdev"                                                           
    Option "SendCoreEvents" "true"                                            
    Option "USB" "on"                                                         
    Option "Type" "stylus"                                                    
    Option "Mode" "absolute"                                                  
    Option "zMin" "0"                                                         
    Option "zMax" "1023"                                                      
    Option               "TopX"          "185"
    Option               "TopY"          "372"
    Option               "BottomX"       "11811"
    Option               "BottomY"       "8793"
    Option               "TopZ"          "32"
EndSection

Monday, October 8, 2018

Organizing photo/video with rating

I use the following rating meaning in Shotwell:

 rejected = candidate for wastebin

 unrated = have not analyzed this photo yet

 1 = keep and return to reanalyze later and maybe then mark as 'rejected' or '2'

 2 = keep and forget

 3 = keep, needs editing

 4 = keep, do not publish -- this is original photo which was edited but saved as a diffenet image file (e.g. edited via external program and saved as IMG000_edit, so look for _edit image)

 5 = publish finished work: a) perfect out of the camera b) was edited (file has 'edited' suffix or tag)

 flagged = used to mark photos for immediate processing, work in progress

And the following workflow:

Folder tree:
YYYY/YYYY_MM_DD_tag1_tag2.../
    - video
        - edited
    - edited
       

1) Mark ranks, add tags.
2) Edit those marked with '3': mark 'flagged'
3) Export final image as '_edited', mark original as '4', clear flag.
4) Add '_edited' to Shotwell, mark as '5'.

Friday, September 1, 2017

Lua rocks on Mac



Install macports, install readline.

Install luajit.

Install luarocks.

Edit luarocks_installed/etc/luarocks/config-5.1.lua to use libs from /opt/local (those from macports):

external_deps_dirs = {
"/opt/local",
}


In luarocks install inspect, prompt.

/luarocks_installed/bin/luap

Enjoy repl with history and autocomplete.

Saturday, August 5, 2017

lubuntu 16.04 experience, amd radeon integrated video hdmi sound problem

Lubuntu 16.04 on

GA-E2100N (rev. 1.0) | Motherboard - GIGABYTE 


AMD® E1-2100 dual-core APU with Radeon™ HD 8210 graphics SoC


- quick to boot, a bit over 200 MB RAM occupied when all is loaded.
- 3D acceleration works out of the box
- no HDMI sound, fixed by installing pulseaudio
- no video playback acceleration -- fixed by installing vdpau-mesa drivers and setting vdpau in the mplayer as output device.

Monday, July 3, 2017

Evaluating Lua

Three active verisons 5.1, 5.2, 5.3. LuaJIT as 5.1 with some nice C integration features.
The most viable is 5.1 because of luajit/lua implementation choice.

Simple scripts startup time is almost the same as a C program (python is way slower to start).
Memory consumption is low. Several interpreters can be run in the same process.
Syntax is simple and yet allows to be used for DSLs, sandboxing.

RTTI is almost not available apart from discovering if the object is a function, a string, a number or a table.
Standard library is almost non-existing, except for Penlight package from LuaRocks package manager.

Documenting tools are rather lacking and buggy (tried LDoc).

Great for prototyping but as soon as a program grows beyond a couple of modules, it needs proper docs tools, higher level objects (OOP) etc. Existing solutions are quite poor.

Could not find a good REPL implementation.

Sunday, May 14, 2017

premake5 android and ios support

newoption {
    trigger = 'platform',
    description = 'platform name',
    value = 'name',
    allowed = {
        { 'android', '' },
        { 'ios', '' },
    }
}

workspace 'mylib'
location '_build'
configurations { 'debug', 'release' }

-------------------
-- Android specific

filter { 'options:platform=android' }
toolset 'gcc'
gccprefix '~/arm14/bin/arm-linux-androideabi-'

if _OPTIONS['platform'] == 'android' then
    premake.override(premake.tools.clang, "gettoolname", function(base, cfg, tool)
        local basetool = base(cfg, tool)
        local toolchain_prefix = cfg.gccprefix
        print("prefix = " .. tostring(toolchain_prefix))
        if toolchain_prefix and basetool then
            return toolchain_prefix .. basetool
        end
        print('tool = ', tool, 'basetool = ', basetool)
        return nil
    end)
end

---------------
-- iOS specific

filter { 'options:platform=ios' }
xcodebuildsettings {
            --["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = "iPhone Developer",
            --IPHONEOS_DEPLOYMENT_TARGET = "10.2",
            SDKROOT = "iphoneos",
            OTHER_LDFLAGS = "-ObjC",
}

if _OPTIONS['platform'] == 'ios' then
--[[
/* Begin XCBuildConfiguration section */
C20C96B51EC86B9100D730E8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
SDKROOT = iphoneos;
         }

OTHER_LDFLAGS = "-ObjC";

--]]
end

------------------
-- Common

filter {}

project 'my_lib'
kind 'StaticLib'
language 'C'
files { '*.h', '*.c' }

filter { 'configurations:debug' }
defines { 'DEBUG' }
-- flags { 'Symbols' }
symbols 'On'

filter { 'configurations:release' }
defines { 'NDEBUG' }
optimize 'On'