Bez kategorii « Różności …

Różności …

14 listopada 2021

github token

Zaszufladkowany do: Bez kategorii — Jacek @ 17:21
git remote set-url origin https://<TOKEN>@github.com/<user_name>/<repo_name>.git

29 października 2021

How to Install Jupyter Notebook on Ubuntu 20.04 / 18.04

Zaszufladkowany do: Bez kategorii — Jacek @ 21:22

How to Install Jupyter Notebook on Ubuntu 20.04 / 18.04

26 września 2021

Docker – Ubuntu install

Zaszufladkowany do: Bez kategorii — Jacek @ 14:54

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

13 września 2021

ubunto 20.04 docker install

Zaszufladkowany do: Bez kategorii — Jacek @ 21:34

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

MongoDB install

Zaszufladkowany do: Bez kategorii — Jacek @ 12:24

Source:

https://linuxhint.com/install_mongodb_ubuntu_20_04/

sudo apt update
sudo apt upgrade
sudo apt install mongodb
sudo systemctl status mongodb
sudo systemctl start mongodb
sudo systemctl stop mongodb
sudo systemctl restart mongodb
sudo systemctl enable mongodb
sudo systemctl stop mongodb

This command will stop the service.
sudo apt purge mongodb
sudo apt autoremove

10 września 2021

Linux One Drive

Zaszufladkowany do: Bez kategorii — Jacek @ 22:22

żródło: https://gist.github.com/starlinq/0f98c6d9339497bb8ac42d67f66f60eb

There are many instructions to syncronize your files with OneDrive cloud-based storage in Linux. However they typically address multiple Linux distributions that often causes a confusion or an use of some commands which have not been actually tested before publishing. This instruction is for Ubuntu 18.04 and 20.04 (64 bit) only.

In order to install onedrive, first you need to install some dependencies and set up git.

Let us open the Terminal application and enter the following:

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git

Lets us move to Downloads directory

cd ~/Downloads

DMD compiler installation

Ubuntu 18.04

Some instructions recommend using snap to install some dependencies, for example here:

If you are using Ubuntu 18.04 or newer, use snap to install dmd

I tried that and found that after such installation some dependencies are not met!

So I recommend you to install those dependencies using classical method like this:

sudo wget https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list
sudo apt-get update --allow-insecure-repositories
sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring
sudo apt-get update && sudo apt-get install dmd-compiler dub

Ubuntu 20.04

We download the 64-bit package from

wget http://downloads.dlang.org/releases/2.x/2.093.1/dmd_2.093.1-0_amd64.deb

and install it at system level

sudo dpkg -i dmd_2.093.1-0_amd64.deb

Then we clone the required repository files with git:

git clone https://github.com/abraunegg/onedrive.git

Then compile and install it:

cd onedrive
./configure
make
sudo make install

The next step, you need to authorize onedrive with Microsoft so it can access your account:

onedrive

Copy the web address appeared in the terminal window right after Authorize this app visiting:, then open any web browser and paste it into the web browser address line.

Log in into your account and grant the application permission to acess your account.

Wait for response …

Then copy and paste the web address of response into corresponding part of the terminal window with prompt Enter the response uri:.

Now the installation has been done.

Before syncronization, let us create a onedrive directory for current user

mkdir -p ~/OneDrive

and copy a configuration file into default directory

cp config ~/.config/onedrive/config

Now we can leave the installation directory

cd

It is a time to check our current configuration

onedrive --display-config

You will see something like this

onedrive version                       = v2.4.0-25-g7f267a5
Config path                            = /home/yourcurrentusername/.config/onedrive
Config file found in config path       = true
Config option 'check_nosync'           = false
Config option 'sync_dir'               = /home/yourcurrentusername/OneDrive
Config option 'skip_dir'               =
Config option 'skip_file'              = ~*|.~*|*.tmp
Config option 'skip_dotfiles'          = false
Config option 'skip_symlinks'          = false
Config option 'monitor_interval'       = 45
Config option 'min_notify_changes'     = 5
Config option 'log_dir'                = /var/log/onedrive/
Config option 'classify_as_big_delete' = 1000
Config option 'sync_root_files'        = false
Selective sync configured              = false

For one time sync, run

onedrive --synchronize

or if you want to monitor your OneDrive storage for changes

onedrive --monitor

Do not forget that onedrive doesn’t start when the user logs in. To run automatically when you log in, you can add onedrive --monitor command to your startup application.

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

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

Ubuntu 18.04 – after install

Zaszufladkowany do: Bez kategorii — Jacek @ 16:25

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

apt install terminator

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

11 listopada 2017

atom shortcuts

Zaszufladkowany do: Bez kategorii — Jacek @ 11:06

ctrl + zaznaczenie  – wielokrotne wpisywanie

Ctrl + Shift + D - powielenie linii
Ctrl + Up (or Down) Arrow - przesunięcie linii

Ctrl + D - wielokrotne zaznaczenie tekstu

Alt + F3 - select all maching characters

30 grudnia 2016

Android emulator

Zaszufladkowany do: Bez kategorii — Tagi: — Jacek @ 15:02

Cannot launch AVD in emulator.
Output:
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

locate libstdc++.so.6

9 sierpnia 2016

Spring and Hibernate but non-Maven project (working in NetBeans), where java.lang.ClassNotFoundException: org.jboss.jandex.IndexView:

Zaszufladkowany do: Bez kategorii — Jacek @ 15:58

In the context of a Spring and Hibernate but non-Maven project (working in NetBeans), where java.lang.ClassNotFoundException: org.jboss.jandex.IndexView:

Add jandex-2.0.0Final.jar (or whatever version works) to your Library. — In a Maven project likely similarly – add it as a dependency

http://stackoverflow.com/questions/29744915/how-to-setup-jpa-project-with-hibernate

3 czerwca 2014

Solaris – Weblogic

Zaszufladkowany do: Bez kategorii — Jacek @ 21:50

Installation.

Installation2.

java    -d64    -Xmx1024m   -jar    wls1033_generic.jar
quickstart
MW_HOME/utils/quickstart/quickstart.sh
MW_HOME = /export/home/oracle/Oracle


jdeveloper – weblogic – not found jrockit
I fixed it by add to top of c:\users{user}\AppData\Roaming\JDeveloper\system{version}\DefaultDomain\bin\setDomainEnv.cmd:
set SUN_JAVA_HOME=E:\Oracle\Java\jdk1.6.0_37
set JAVA_VENDOR=Sun

7 maja 2014

JOINS

Zaszufladkowany do: Bez kategorii,SQL — Tagi: — Jacek @ 07:43

references = foreign key

equijoin = inner join

21 lutego 2014

Set operators.

Zaszufladkowany do: Bez kategorii — Jacek @ 07:08

Starsze wpisy »

Strona startowa: www.jaceksen.pl