Różności …

Różności …

4 czerwca 2021

Zaszufladkowany do: Bez kategorii — Jacek @ 10:29
Switch Display Manager in Ubuntu 20.04
cat /etc/X11/default-display-manager

for GDM3 –
/usr/sbin/gdm3

for LightDM –

/usr/sbin/lightdm

and SDDM –

/usr/sbin/sddm
systemctl status display-manager
sudo dpkg-reconfigure <Default_Display_Manager>
sudo dpkg-reconfigure gdm3
sudo dpkg-reconfigure lightdm
sudo dpkg-reconfigure sddm
source: https://techpiezo.com/linux/switch-display-manager-in-ubuntu-20-04/

ssh -L 5900:localhost:5900 username@10.17.17.49
vncviewer localhost

25 marca 2021

Angular tuple type, arrays

Zaszufladkowany do: Angular — Jacek @ 09:06

I’m really confused about this now. I’m pretty sure that

let x:SomeType[] = []

is equivalent to

let x: Array<SomeType> = []

but is

let x:[SomeType] = []

also equivalent and correct?

asked Aug 28 ’20 at 0:13
Michael Dausmann

3,41822 gold badges2626 silver badges3838 bronze badges

2 Answers

10

No. [SomeType] represents a tuple type, i.e., an array with exactly one element of SomeType

[string, number], for example, would match an array like ["test", 0]

source:

https://stackoverflow.com/questions/63625736/is-interface-a-valid-array-definition-in-typescript

8 stycznia 2021

MongoDB, Node.js – install

Zaszufladkowany do: JS,Linux,Programowanie — Jacek @ 11:21

sudo systemctl start mongod

sudo systemctl status mongod
sudo systemctl enable mongod
sudo systemctl stop mongod
sudo systemctl restart mongod
Node.js
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash source ~/.bashrc
nvm list-remote
nvm install v13.6.0 nvm use v13.6.0 nvm current
node -v

7 stycznia 2021

PHP Ubuntu 20

Zaszufladkowany do: Programowanie — Jacek @ 15:54

Jakby ktoś musiał jeszcze coś w tym PHP zrobić … (choć po co???? przecież jest JS)

Installing PHP 7.4 with Apache

If you’re using Apache as your web server, run the following commands to install PHP and Apache PHP module:

sudo apt updatesudo apt install php libapache2-mod-php

Once the packages are installed, restart Apache for the PHP module to get loaded:

sudo systemctl restart apache2

Installing PHP 7.4 with Apache

If you’re using Apache as your web server, run the following commands to install PHP and Apache PHP module:
sudo apt updatesudo apt install php libapache2-mod-php

Once the packages are installed, restart Apache for the PHP module to get loaded:

sudo systemctl restart apache2

KATALOG ROOT APACHE2:
/var/www/html/

29 grudnia 2020

Ubuntu post install

Zaszufladkowany do: Angular,JavaScript,Linux,Programowanie,React — Jacek @ 08:23
sudo apt-get update
sudo apt-get install build-essential

17 grudnia 2020

Ubuntu application icon favourities ulubione

Zaszufladkowany do: Linux — Jacek @ 17:25

/usr/share/applications

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Blender
Comment=Blender
Exec=blender
Icon=/home/tigran/bin/blender-2.91.0-linux64/blender.svg
Terminal=false

1 grudnia 2020

Ubuntu – disable history of files

Zaszufladkowany do: Linux — Jacek @ 10:17
$ rm ~/.local/share/recently-used.xbel # clear current file history
$ touch ~/.local/share/recently-used.xbel # create a 0-byte history file
$ sudo chattr +i ~/.local/share/recently-used.xbel # make it readonly

25 listopada 2020

Ubunutu 20 workspace shortcuts

Zaszufladkowany do: Linux — Jacek @ 13:46

install gnome-tweaks

jacek@comp:~$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 ‘["<Alt>5"]‘
jacek@comp:~$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 ‘["<Alt>6"]‘
jacek@comp:~$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 ‘["<Alt>7"]‘
jacek@comp:~$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 ‘["<Alt>8"]‘
jacek@comp:~$ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 ‘["<Alt>9"]‘

14 listopada 2020

ubuntu no working init found

Zaszufladkowany do: Linux — Jacek @ 11:36
lsinitramfs
update-initramfs -u -k 5.4.0-53-generic

26 lipca 2020

ubuntu display problems

Zaszufladkowany do: Linux — Jacek @ 12:24

sudo apt update

sudo apt upgrade

ubuntu-drivers devices

sudo ubuntu-drivers autoinstall

lub

sudo apt install nvidia-420

28 lipca 2019

Node.JS: Getting error : [nodemon] Internal watch failed: watch ENOSPC

Zaszufladkowany do: Bez kategorii — Jacek @ 14:59
sudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -p
https://stackoverflow.com/questions/34662574/node-js-getting-error-nodemon-internal-watch-failed-watch-enospc

16 lipca 2019

gnome system monitor

Zaszufladkowany do: Linux — Jacek @ 16:33

https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet

http://ubuntuhandbook.org/index.php/2019/03/display-cpu-memory-network-usage-in-ubuntu-18-04-panel/

Ubuntu 18.04 – after install

Zaszufladkowany do: Bez kategorii — Jacek @ 16:25

https://www.youtube.com/watch?v=qTsPLCJdbJw

apt install terminator

1 lipca 2019

mysql access denied for user root@localhost

Zaszufladkowany do: MySQL — Jacek @ 08:55
sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

With a single query we are changing the auth_plugin to mysql_native_password and setting the root password to root (feel free to change it in the query)

Now you should be able to login with root. More information can be found in mysql documentation

(exit mysql console with Ctrl + D or by typing exit)

https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost


25 czerwca 2019

ionic inn-app-browser ERR_CLEARTEXT_NOT_PERMITTED

Zaszufladkowany do: Android — Jacek @ 16:19

To solve the problem there’s other option. in file resources/android/xml/network_security_config.xml. insert:

<network-security-config>
   <base-config cleartextTrafficPermitted="true">
       <trust-anchors>
           <certificates src="system" />
       </trust-anchors>
   </base-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain>localhost</domain>
        <domain includeSubdomains="true">192.168.7.213:8733</domain>
    </domain-config>
</network-security-config>

https://stackoverflow.com/questions/54752716/why-am-i-seeing-neterr-cleartext-not-permitted-errors-after-upgrading-to-cordo

Open the android manifest file (android/app/src/main/AndroidManifest.xml) and add
android:usesCleartextTraffic="true"

to the application tag

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="tangerine_ui"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true">

https://github.com/flutter/flutter/issues/30368

----------------------

config.xml:

<platform name=”android”>
<edit-config file=”app/src/main/AndroidManifest.xml” mode=”merge” target=”/manifest/application” xmlns:android=”http://schemas.android.com/apk/res/android”>
<application android:networkSecurityConfig=”@xml/network_security_config” android:usesCleartextTraffic=”true” />
</edit-config>

19 czerwca 2019

Maximize and unmaximize a window

Zaszufladkowany do: Bez kategorii — Jacek @ 09:33

You can maximize a window to take up all of the space on your desktop and unmaximize a window to restore it to its normal size. You can also maximize windows vertically along the left and right sides of the screen, so you can easily look at two windows at once. See Tile windows for details.

To maximize a window, grab the titlebar and drag it to the top of the screen, or just double-click the titlebar. To maximize a window using the keyboard, hold down the Super key and press , or press Alt+F10.

To restore a window to its unmaximized size, drag it away from the edges of the screen. If the window is fully maximized, you can double-click the titlebar to restore it. You can also use the same keyboard shortcuts you used to maximize the window.

https://help.ubuntu.com/stable/ubuntu-help/shell-windows-maximize.html.en

Keyboard shortcut for launching application from dock in Ubuntu 18

Zaszufladkowany do: Bez kategorii — Jacek @ 09:30
https://askubuntu.com/questions/1082772/keyboard-shortcut-for-launching-application-from-dock-in-ubuntu-18

Simply press and hold Super+Q. You should see numbers appearing next to the application icons. Then release Q and press the number associated to your target application to launch it.

You can alternatively press Super+number directly to launch the application without pressing Super+Q first.

Notes:

  1. If pressing Super+Q fails to show the numbers, run the following command first.
    gsettings set org.gnome.shell.extensions.dash-to-dock hot-keys false
    
  2. This shortcut only works with the keyboard’s top row number keys, not those of the numpad. You can install a GNOME shell extension called AppKeys to make it work with the numpad too.

Ubuntu 18 workspaces shortcuts

Zaszufladkowany do: Bez kategorii — Jacek @ 09:25

The only way I have found to modify the keyboard shortcuts for workspaces 5 and up in GNOME Flashback, is through a shell using the dconf command.

$ dconf read /org/gnome/desktop/wm/keybindings/switch-to-workspace-1
['<Primary>F1']

Here I read the shortcut setting for the first workspace, to get an idea about the syntax to use when setting values for the missing shortcuts. I’m using CTRLF1 myself.

To add shortcuts for the remaining workspaces, just modify the value returned above to match the workspace number, and use dconfto apply them:

$ dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-5 "['<Primary>F5']"
$ dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-6 "['<Primary>F6']"

https://askubuntu.com/questions/332264/13-04-more-than-four-workspace-shortcuts-in-gnome-flashback-no-effects


	

17 czerwca 2019

mount crypto_luks

Zaszufladkowany do: Bez kategorii — Jacek @ 15:59

https://evilshit.wordpress.com/2012/10/29/how-to-mount-luks-encrypted-partitions-manually/

blkid | grep crypto
cryptsetup luksOpen /dev/sda2/ crypthome
mkdir /mnt/crypthome && mount /dev/mapper/crypthome /mnt/crypthome
unknown lvm2_member
https://www.svennd.be/mount-unknown-filesystem-type-lvm2_member/
lvmdiskscan
lvscan
You used the exact same name (ubuntu-vg) for your new volume group as the old volume group. You must give them unique names. You can rename one of the groups using vgrename and its UUID.

Find the UUID with vgdisplay and then rename the volume group:
vgrename <VG UUID> new_name


  • root@svennd:~# fdisk -l /dev/sdd
  • Disk /dev/sdd: 233.8 GiB, 251000193024 bytes, 490234752 sectors
  • Units: sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 512 bytes
  • I/O size (minimum/optimal): 512 bytes / 512 bytes
  • Disklabel type: dos
  • Disk identifier: 0x0009345d
  • Device Boot Start End Sectors Size Id Type
  • /dev/sdd1 * 63 208844 208782 102M 83 Linux
  • /dev/sdd2 208845 488247479 488038635 232.7G 8e Linux LVM
(/dev/sdi1 is /boot partition, /dev/sdi2 is where the /home data resides) Seems lvm2 tools also provide a way to check if it is lvm or not, using lvmdiskscan (/dev/sdd2 here)
  • root@svennd:~# lvmdiskscan
  • /dev/sdb1 [ 1.82 TiB]
  • /dev/sdc2 [ 149.04 GiB]
  • /dev/sdd1 [ 101.94 MiB]
  • /dev/sdd2 [ 232.71 GiB] LVM physical volume
  • 0 disks
  • 4 partitions
  • 0 LVM physical volume whole disks
  • 1 LVM physical volume
Fine, now let’s scan what lv’s are to be found using lvscan
  • root@svennd:~# lvscan
  • inactive '/dev/VolGroup00/LogVol00' [230.75 GiB] inherit
  • inactive '/dev/VolGroup00/LogVol01' [1.94 GiB] inherit
Since this is an old disk in an enclosure, it is not activated on system boot. So we need to “activate” this lvm volume.
  • root@svennd:~# vgchange -ay
  • 2 logical volume(s) in volume group "VolGroup00" now active
and bam, ready to mount :
  • root@svennd:~# lvscan
  • ACTIVE '/dev/VolGroup00/LogVol00' [230.75 GiB] inherit
  • ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GiB] inherit
now to mount :
  • mount /dev/VolGroup00/LogVol00 /mnt/disk
success !

27 marca 2019

GRUB repair

Zaszufladkowany do: Bez kategorii — Jacek @ 13:44

GRUB repair

How to find out where the “grub” is installed

sudo dd bs=512 count=1 if=/dev/sda 2>/dev/null | strings

The results in my device

ZRr=
`|f
\|f1
GRUB
Geom
Hard Disk
Read
 Error
Starsze wpisy »

Strona startowa: www.jaceksen.pl