Różności …

Różności …

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

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

20 marca 2018

angular jquery “is not a function”

Zaszufladkowany do: Programowanie — Tagi: — Jacek @ 15:04
import $ from 'jquery'
declare var $: $

16 lutego 2018

adb devices not found

Zaszufladkowany do: Android,Programowanie — Tagi: — Jacek @ 12:04

Very likely udev is incorrectly adding your device. I too had this problem & came across a relatively simple solution.

Find your device in lsusb

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 05c8:03a2 Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 001 Device 006: ID 18d1:4ee7 Google Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Point of interest in this case:

Bus 001 Device 006: ID 18d1:4ee7 Google Inc.

Check out the corresponding device file

$ ls -l /dev/bus/usb/001/006

Likely you will see something like

crw-rw-r-- 1 root root 189, 5 Sep  8 21:47 /dev/bus/usb/001/006

This which means that the device file will be owned by the user root and the group root, which is why adb can access it as root but not as your standard user.

This can be solved by creating a new udev rule – I used /etc/udev/rules.d/51-android.rules- to add the device to the group plugdev, which adb already assumes you to be a member of (you shoukd be, check using id)

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0660",
GROUP="plugdev", SYMLINK+="android%n"

**Remember to replace the ATTR{idProduct}==”4ee7″ with your own product id that you found out in step one. ** (If your vendor isn’t Google Inc., also replace the vendor id with the one before the colon in lsusb).

Now just unplug your device and plug it back in (udev should automatically respond to the new file) and tadaa:

$ adb devices
List of devices attached
YC873P0G    device
SOURCE:
https://askubuntu.com/questions/908306/adb-no-permissions-on-ubuntu-17-04

Android – enable the developer options. Phone/Tablet

Zaszufladkowany do: Android,Programowanie — Tagi: — Jacek @ 11:02

First, you must enable the developer options:

  1. Open the Settings app.
  2. (Only on Android 8.0 or higher) Select System.
  3. Scroll to the bottom and select About phone.
  4. Scroll to the bottom and tap Build number 7 times.
  5. Return to the previous screen to find Developer options near the bottom.

Open Developer options, and then scroll down to find and enable USB debugging.

7 lutego 2018

Android Studio Font Size

Zaszufladkowany do: Android — Tagi: — Jacek @ 07:35

File -> Settings -> Editor -> General -> Change font size (Zoom) with Ctrl+Mouse Wheel

22 grudnia 2017

Mount google drive on Ubuntu

Zaszufladkowany do: Linux — Tagi: — Jacek @ 10:40
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse
google-drive-ocamlfuse
mkdir ~/googleDrive
podmontowanie:
google-drive-ocamlfuse ~/googleDrive
odmontowanie:
fusermount -u ~/googleDrive
google-drive-ocamlfuse -- help

8 grudnia 2017

linux deb packages

Zaszufladkowany do: Linux — Tagi: — Jacek @ 09:28
sudo apt install gdebi-core
sudo gdebi teamviewer*.deb

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

7 listopada 2017

Android shortcuts

Zaszufladkowany do: Android,Programowanie — Tagi: — Jacek @ 11:23

Ctrl + Shift + Space – code completion

Ctrl + Space – code completion

Ctrl + O – override methods

Shift + F6 – rename classes, methods, variables

30 października 2017

Android cert export

Zaszufladkowany do: Android,Programowanie — Tagi: — Jacek @ 17:42

keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore

4 sierpnia 2017

Eclipse font size

Zaszufladkowany do: Java,Programowanie — Tagi: — Jacek @ 07:08

https://marketplace.eclipse.org/content/fontsize

General → Appearance → Colors and Fonts → Java Editor text font

3 sierpnia 2017

the superclass javax.servlet.http.httpservlet was not found on the java build path

Zaszufladkowany do: JAVA EE,Java — Tagi: , — Jacek @ 08:17
  • Maven
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
  • Gradle
    configurations {
        provided
    }
    sourceSets {
        main { compileClasspath += configurations.provided }
    }
    dependencies {
        provided 'javax.servlet:javax.servlet-api:3.1.0'
    }

ECLIPSE – Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

Zaszufladkowany do: Java — Tagi: — Jacek @ 07:06
in pom.xml:
<project>
  ...
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  ...
</project>
mvn package
« Nowsze wpisyStarsze wpisy »

Strona startowa: www.jaceksen.pl