Giter Club home page Giter Club logo

stuff-linux's People

Contributors

midenok avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dcyou

stuff-linux's Issues

KDE Plasma panel vertical orientation wrong element sizes

From here:

you can edit file usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/main.qml line 34 : property int itemSize: Math.min(Math.min(width, height), units.iconSizes.medium) change value units.iconSizes. "small", "smallMedium", "medium", "large", "huge", "enormous" smallMedium is good for me

Ubuntu: add-apt-repository fails after base-files upgrade

Bug (saved)
Workaround

add-apt-repository ppa:webupd8team/atom
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 91, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/saucy

base-files must depend on proper version of python-apt-common!

Move system from lian to dull

Preserve: indicator-cpufreq

  1. Copying from lian to 4Tb HD part 1
root@lian:bind# mount --bind /home home
root@lian:bind# mount --bind / root
root@lian:bind# mount --bind /var var
root@lian:bind# mount --bind /usr usr
root@lian:bind# mount --bind /storage storage
root@lian:bind# rshost . /mnt/1

GDB step bison (.yy) sources

See this:

class ContinueUntilSource(gdb.Command):
    def __init__(self):
        super().__init__(
            'cus',
            gdb.COMMAND_BREAKPOINTS,
            gdb.COMPLETE_NONE,
            False
        )
    def invoke(self, argument, from_tty):
        argv = gdb.string_to_argv(argument)
        if argv:
            gdb.write('Does not take any arguments.\n')
        else:
            done = False
            thread = gdb.inferiors()[0].threads()[0]
            while True:
                message = gdb.execute('si', to_string=True)
                if not thread.is_valid():
                    break
                try:
                    path = gdb.selected_frame().find_sal().symtab.fullname()
                except:
                    pass
                else:
                    if os.path.exists(path):
                        break
ContinueUntilSource()

from here.

network-manager crash

Patch

--- debian/rules~       2017-09-22 20:56:30.000000000 +0300
+++ debian/rules        2018-02-24 00:16:33.344582975 +0300
@@ -42,15 +42,17 @@
                --enable-ifupdown \
                --enable-config-plugin-ibft \
                --enable-introspection \
-               --enable-gtk-doc \
+               --disable-gtk-doc \
                --enable-concheck \
                --disable-teamdctl \
                --enable-json-validation \
                --enable-bluez5-dun \
                --enable-vala \
                --with-selinux=yes \
-               --with-tests \
-               --with-libaudit=yes
+               --enable-tests=no \
+               --with-libaudit=yes \
+               CFLAGS=-O0 \
+               CXXFLAGS=-O0
 
 override_dh_missing:
        find debian/tmp -name '*.la' -print -delete

Build

debian/rules build-arch

Automatically modify file group ownership on each open for write

Need to talk with EXT4 guys.

As was said here:

Good question and any suggested resolutions are not handy. I want to automatically change file group ownership to track down changes I do in /etc. Group ownership is not very useful when it have g=r,o=r. And with updated ownership I will be able to track my own changes with command:

find /etc -type f -group my_group

Screwing VCS to /etc is tedious and boring (to commit and comment each change). It is not usable.

Figuring out changes through packaging system like Debian does is not 100% reliable and not handy (requires slow run).

I would say, group ownership is perfect for this task!

Console rotation

Problem

NVidia doesn't support framebuffer. See ls /dev/fb*: only fb0 exists. So it is impossible to have dual-head mode for single nvidia card.

Configuration

For counter-clockwise monitor

fbcon=rotate:1

For clockwise monitor

fbcon=rotate:3

Misc

Install fbset.

Links

vortex system

TODO:

  • make /boot separate partition
  • setup refind
  • install grub into boot sector
  • document vertex cloning commands
  • rotate grub menu? GRUB_GFXMODE=1200x1920x32
Number  Start        End          Size        File system     Name      Flags
 1      2048s        4095s        2048s                       grub
 2      4096s        208895s      204800s     fat16           efi       boot, esp
 3      208896s      823295s      614400s                     boot
 4      823296s      2097151s     1273856s                    reserved
 5      2097152s     505462783s   503365632s                  lvm
 6      505462784s   1258291199s  752828416s  ext4            storage
 7      1258291200s  1392508927s  134217728s  linux-swap(v1)  swap

Number  Start    End      Size     File system     Name      Flags
 1      0.00GiB  0.00GiB  0.00GiB                  grub
 2      0.00GiB  0.10GiB  0.10GiB  fat16           efi       boot, esp
 3      0.10GiB  0.39GiB  0.29GiB                  boot
 4      0.39GiB  1.00GiB  0.61GiB                  reserved
 5      1.00GiB  241GiB   240GiB                   lvm
 6      241GiB   600GiB   359GiB   ext4            storage
 7      600GiB   664GiB   64.0GiB  linux-swap(v1)  swap
root@lian:midenok# dmraid -rD
/dev/sda: isw, "isw_bjedijgech", GROUP, ok, 937703086 sectors, data@ 0
/dev/sdb: isw, "isw_bjedijgech", GROUP, ok, 937703086 sectors, data@ 0
root@lian:midenok# dmraid -s
*** Group superset isw_bjedijgech
--> Subset
name   : isw_bjedijgech_Vortex
size   : 1875397120
stride : 256
type   : stripe
status : ok
subsets: 0
devs   : 2
spares : 0
vgcreate vg0 /dev/md126p5
lvcreate -L122884m vg0 -n lv0
vgcreate vg1 /dev/vg0/lv0

lvcreate -L6g vg1 -n root
lvcreate -L40g vg1 -n usr
lvcreate -L14g vg1 -n var
lvcreate -L60g vg1 -n home
cd /dev/vg1
for d in *; do
  # mkfs.ext4 -L vortex-$d $d
  mkdir -p /mnt/dst-$d
  mount $d /mnt/dst-$d
done

nl: turn off line numbering

There is 3 variants of format:

FORMAT is one of:

  ln   left justified, no leading zeros
  rn   right justified, no leading zeros
  rz   right justified, leading zeros

Add fourth option 'nn' to turn off numbering at all. This is useful for prefixing lines with -s option.

.pam_environment doesn't work (ssh-agent global to all user sessions)

Posted bug.

.pam_environment is pam.conf

~/.pam_environment

SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh_auth_sock"

~/.config/systemd/user/ssh-agent.service

[Unit]
Description=ssh-agent

[Service]
ExecStart=/usr/bin/ssh-agent -d -a %t/ssh_auth_sock
ExecStartPost=/bin/sh -c "export SSH_AUTH_SOCK=%t/ssh_auth_sock; cd %h/.ssh; if [ -f .session-keys ]; then /usr/bin/ssh-add $$(cat .session-keys); else true; fi"
SuccessExitStatus=2

[Install]
WantedBy=default.target

/etc/X11/Xsession.options

    USER: disable ssh-agent in startkde since it is started by systemd
    
    See ~/.config/systemd/user/ssh-agent.service

diff --git a/X11/Xsession.options b/X11/Xsession.options
index fc45bf9..3c1ff13 100644
--- a/X11/Xsession.options
+++ b/X11/Xsession.options
@@ -5,5 +5,5 @@
 allow-failsafe
 allow-user-resources
 allow-user-xsession
-use-ssh-agent
+# use-ssh-agent
 use-session-dbus

Links

How to start and use ssh-agent as systemd service?

Ubuntu install from .iso image

Need TODO:

  1. Apply fix;
  2. Parse /proc/cmdline and get iso-scan/filename param value;
  3. Somehow determine boot device (I don't know how) and mount it;
  4. Bind .iso file with losetup.
  5. Later on (before disk partitioning i.b.) installation process asks for unmounting mounted devices. The question must be disabled for a device containing .iso image.

doll backups

Linux dull 5.0.0-8-lowlatency #9-Ubuntu SMP PREEMPT Tue Mar 12 22:38:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.10
DISTRIB_CODENAME=cosmic
DISTRIB_DESCRIPTION="Ubuntu 18.10"

handbrake: UI boredom

Probably, move this issue to better place.

There are some suggestions:

  • limit scan to a list of filemasks (no need to scan 500 JPEGs for 4 MOVs);
  • remove nagging questions (i.e. "Are you sure?" and similar stupid questions and irritating OKs) in particular:
    ** when updating profile (possible auto-update selected profile)
    ** when adding jobs to queue (when it "warns" about same dir or something like that)
    ** when removing running job from queue (it "warns" about stopping encoding process, etc., incomplete file should be removed)
  • autogenerated titles just numbers, no filenames in drop-down list is inconvenient
  • close to systray, minimize to taskbar -- this is expected from systray-oriented app. Exit via context menu on systray or from File.

Configurable options should be corrected accordingly.

Fix time

Uninstall ntp, ntpdate
Install systemd-timesyncd

Swapping freezes system

Encage xorg shell into container

TODO

  • Setup test container with low memory
  • Provoke swapping lock
  • Try to limit kswapd with blkio

Limit swapping process

kswapd0 kernel helper.
Limit CPU and IO bandwidth to say 50%.

  • blkio limits IO

Kernel settings

  • vm.overcommit_memory
  • vm.overcommit_ratio
  • vm.swappiness

Note: swappiness=0 lock happens faster

Links

Info

swappiness

This control is used to define how aggressive the kernel will swap
memory pages.  Higher values will increase aggressiveness, lower values
decrease the amount of swap.  A value of 0 instructs the kernel not to
initiate swap until the amount of free and file-backed pages is less
than the high water mark in a zone.

The default value is 60.

aptitude: keybinding to New Flat Package List

in ui.cc:

  cw::menu_info(cw::menu_info::MENU_ITEM, N_("New ^Flat Package List"), NULL,
       N_("View all the packages on the system in a single uncategorized list"),
       sigc::ptr_fun(do_new_flat_view_with_new_bar)),

replace NULL with "NewFlatView",

for

  cw::menu_info(cw::menu_info::MENU_ITEM, N_("New Package ^View"), NULL,
       N_("Create a new default package view"),
       sigc::ptr_fun(do_new_package_view_with_new_bar)),

set "NewPackageView",

for any other NULL values, set respective string values to gain ability to set key-bindings to any menu option.

Auto-pager depending on input lines

Let's call it best (less -> more -> most -> best, ha-ha, false logic).

It looks at STDIN data and detects line length. Then depending on that it execs less or cat or anything. Should be configurable: max data read, what to exec at what conditions, etc. More interesting feature: rules depending content type (similar to what file command does).

screen: PID of client

Bug 43533

From:   Aleksey Midenkov
Subject:    Coping with screen session and ssh-agent session
Date:   Wed, 17 Oct 2012 18:22:30 +0400
This is well known problem that SSH client cannot connect to SSH-AGENT from
SCREEN session. I will briefly refresh your memory on it. OpenSSH uses
SSH_AGENT_SOCKET environment variable to connect SSH client and agent to get
authentication data. The problem is, that SSH_AGENT_SOCKET is different each
time you connect to host. But SCREEN session retains old value
from the time session was first created. As a result SSH client inside SCREEN
cannot use authentication keys from SSH-AGENT and asks for password.

There are already number of scripted solutions for this problem, that exist on
the net. But none of what I found is fully working. I will skip delving into
deficiencies of their implementations, but will try to deduce universal way
of what should be done for coping with this problem.

First, we need shell to be able to update SSH_AGENT_SOCKET before each command
it executes. For example, in BASH it can be done by 'trap ... DEBUG'.

Then, we need actual SSH_AGENT_SOCKET value for current running SCREEN
session. And this is hardest and in fact impossible part to find it at
runtime. Of course, we could lend to the method of leaving some traces upon
SSH connection like do all the existing examples I've seen. But this, as was
said, lacks universality and leads to deficiency of racing condition.

What should we do to properly find SSH_AGENT_SOCKET, is to trace the path from
the point of running shell inside SCREEN session to SSH connection that uses
this session. And here what I found about what we can do and what we cannot
do. The final goal is to find PID of SSH client. By knowing that PID we can
easily find socket in /tmp/ssh-*$PID/agent.$PID and that will be the value for
SSH_AGENT_SOCKET. To find PID of SSH we need to know PID of SCREEN client
(i.e. 'screen -r' command). By knowning PID of SCREEN client we can easily
find PID of SSH: walk through /proc filesystem.

And what I could not find is how to find out PID of SCREEN client by PID
of SCREEN daemon. The both are connected to SCREEN socket, but there is no
permission to find all processes opening this socket. There is no commands
inside SCREEN to find it. There is interactive command 'displays' that can be
of some help: at least it displays used PTS, but there is no ability to run
it in non-interactive way. Ideally, 'screen -list' should print instead of
just '(Attached)' something like '(Attached to PID)'. And that would be
enough to satisfy my needs.

Letter source

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.