воскресенье, 20 сентября 2020 г.

SP Flash Tool, Linux и фриз при прошивке

В консоли имеем: 
connect DA end stage: 2, enable DRAM in 1st DA: 0
COM port is open. Trying to sync with the target...

 

проблема в modemmanager - можно снести на время прошивки

sudo dpkg --remove --force-all modemmanager

sudo systemctl restart udev

понедельник, 12 августа 2019 г.

Mint reminder and stickynotes

sudo apt-add-repository ppa:umang/indicator-stickynotes
sudo apt update
sudo apt install indicator-stickynotes
Alt+F2  - indicator-stickynotes



indicator-stickynotes
sudo apt install alarm-clock-applet
Alt+F2  - alarm-clock-applet

вторник, 16 апреля 2019 г.

NFS share directory

On server (192.168.1.2)

apt-get install nfs-kernel-server nfs-common

/etc/exports
/data 192.168.1.3(rw,insecure,nohide,all_squash,anonuid=1000,anongid=1000,no_subtree_check)

/data - shared directory (server)
192.168.1.3 - remote server (client)

sudo /etc/init.d/nfs-kernel-server restart
or refresh config
sudo exportfs -a


On client (192.168.1.3)

apt-get install nfs-common

sudo mount -t nfs -O uid=1000,iocharset=utf-8 192.168.1.2:/data /Nfs_Mount

/Nfs_Mount - mount point for shared directory

пятница, 12 апреля 2019 г.

Mint postinstall

Appearance

Menu -> Settings -> Appearance ->
Style = Mint-X-Teal
Icons = Mint-X-Aqua
Fonts = Ubuntu (Light) 11-12, Monospace 10-11. Disable anti-aliasing, Hinting Full, 96 DPI



Apt

/etc/apt/sources.list.d/official-package-repositories.list - change ftp.byfly.by/pub/ubuntu

apt install aptitude mc ssh x2x libreoffice xscreensaver

apt install ttf-mscorefonts-installer



Chrome

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'

sudo apt-get update

sudo apt-get install google-chrome-stable



Java

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install maven gradle oracle-java8-installer oracle-java8-set-default

add to /etc/environment or /etc/profile

JAVA_HOME=/usr/lib/jvm/java-8-oracle

reload in terminal: source /etc/environment




Idea

echo "fs.inotify.max_user_watches = 524288" >  /etc/sysctl.d/90-idea.conf

sysctl -p --system


Maven issue "Loading archetype list..." : http://mldav.blogspot.com.by/2015/12/intellij-idea-loading-archetype-list.html

Build,Execution,Deployment → Build Tools → Maven → Importing need to set "VM options for importer = -Xmx1024m"


понедельник, 1 октября 2018 г.

Mysql 5.7 root empty password and Ubuntu

sudo mysql -u root

mysql> use mysql;

mysql> update user set plugin='mysql_native_password' where User='root';

mysql> set password = password('_new_root_password_');

[mysql] flush privileges;

check:

mysql -u root -p
enter new root password

пятница, 21 сентября 2018 г.

Diff for binary files

diff -y <(xxd foo1.bin) <(xxd foo2.bin) | colordiff

среда, 19 сентября 2018 г.

Viber and Ubuntu 18.04

Download Viber
sudo dpkg -i viber.deb
sudo aptitude install -f
sudo aptitude install libqt5gui5


1. After executing command
sudo dpkg -i viber.deb

....
dpkg: dependency problems prevent configuration of viber:
 viber depends on libcurl3; however:
  Package libcurl3 is not installed.
 viber depends on gstreamer1.0-pulseaudio; however:
  Package gstreamer1.0-pulseaudio is not installed.
....

2. So now we have to fix dependencies
sudo aptitude install -f

Try to start Viber

/opt/viber/Viber
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Reinstalling the application may fix this problem.
Aborted
3. Install Qt5
sudo aptitude install libqt5gui5

среда, 22 августа 2018 г.

Recreate mysql data dir

Recreate mysql data dir (without backup)


systemctl stop mysql

(rm -r /var/lib/mysql)
mkdir /var/lib/mysql
chown mysql. /var/lib/mysql

mysqld --initialize

You can find password for root in /var/log/mysql/error.log
~A temporary password is generated for root@localhost: xxxxxxxx~

mysql -u root -p

systemctl start mysql

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

среда, 16 мая 2018 г.

XML pretty command line output

XML pretty command line output

sudo apt install libxml2-utils

and use " | xmllint --format - "

for example
echo '<root><test a="b">value</test><check value="new" /></root>' |  xmllint --format -

понедельник, 22 января 2018 г.

Mysql copy database

sudo apt-get install mysql-utilities

mysqldbcopy \
    --source=root:your_password@localhost \
    --destination=root:your_password@localhost \
    sitedb1:sitedb2

or

mysqldump db_name | mysql new_db_name

пятница, 19 января 2018 г.

Lubuntu Shift + NumPad work like Windows

Set "Keyboard Layout Handler" (in tray) - "Advanced setxkbmap Options" - value = numpad:microsoft
and right click icon for saving.

or

change this option in file ~/.config/lxpanel/Lubuntu/panels/panel

Plugin {
     type=xkb
     Config {
     ......
         AdvancedOpt="numpad:microsoft"
     }
}

среда, 17 января 2018 г.

Mysql and new location for data with Errcode: 13 - Permission denied


For new instance data dir:

mysqld --initialize

mysqld: Can't create directory '/xxxx/mysql/' (Errcode: 13 - Permission denied)

add to file /etc/apparmor.d/ usr.sbin.mysqld new location

# Allow data dir access
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
 /xxxx/mysql/ r,  /xxxx/mysq/** rwk,
and reload apparmor

service apparmor reload


other way

apt install appamor-utils
aa-disable /usr/sbin/mysqld
Disabling /usr/sbin/mysqld.

mysqld --initialize

You can find password for root in /var/log/mysql/error.log
A temporary password is generated for root@localhost: xxxxxxxx

понедельник, 15 января 2018 г.

Lubuntu 16.04 repeat key functionality doesn't work

Fix for notebook Lenovo Ideapad 700-15ISK

sudo su
echo "blacklist peaq_wmi" >> /etc/modprobe.d/50-blacklist.conf

пятница, 12 января 2018 г.

Ubuntu iso and UEFI usb stick

Get etcher app from https://etcher.io and write Ubuntu iso.

пятница, 15 декабря 2017 г.

Удаления старых ядер из Ubuntu

удалит все кроме 3х самых новых

 sudo apt-get install bikeshed
 sudo purge-old-kernels --keep 3


или


удалит все кроме 2х последних

sudo apt-get purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | head -n -1)

sudo apt-get autoclean
sudo apt-get autoremove


четверг, 7 сентября 2017 г.

Oracle SQL scripts for checking

SQL request 15 min

select a.user_id, d.username, s.sql_text, sum(a.wait_time + a.time_waited) total_wait_time from v$active_session_history a, v$sqlarea s, dba_users d where a.sample_time between sysdate-30/2880 and sysdate and a.sql_id = s.sql_id and a.user_id = d.user_id group by a.user_id, s.sql_text, d.username order by total_wait_time desc;


Object for 15 min

select o.owner, o.object_name, o.object_type, a.event, sum(a.wait_time + a.time_waited) total_wait_time from v$active_session_history a, dba_objects o where a.sample_time between sysdate-30/2880 and sysdate and a.current_obj# = o.object_id group by o.owner, o.object_name, o.object_type, a.event order by total_wait_time desc;





среда, 6 сентября 2017 г.

Oracle DB 12c и новый пользователь/схема

Имеем Oracle 12c и необходимо создать пользователя DEV. Из sql консоли:

CREATE USER DEV IDENTIFIED BY DEVPASS
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 1000M ON USERS


если получили ошибку вида ORA-65096: invalid common user or role name in oracle.
надо выполнить
alter session set "_ORACLE_SCRIPT"=true; 

затем раздать нужные права

GRANT CREATE SESSION TO DEV
GRANT CREATE TABLE TO DEV
GRANT CREATE PROCEDURE TO DEV
GRANT CREATE TRIGGER TO DEV
GRANT CREATE VIEW TO DEV
GRANT CREATE SEQUENCE TO DEV
GRANT ALTER ANY TABLE TO DEV
GRANT ALTER ANY PROCEDURE TO DEV
GRANT ALTER ANY TRIGGER TO DEV
GRANT ALTER PROFILE TO DEV
GRANT DELETE ANY TABLE TO DEV
GRANT DROP ANY TABLE TO DEV
GRANT DROP ANY PROCEDURE TO DEV
GRANT DROP ANY TRIGGER TO DEV
GRANT DROP ANY VIEW TO DEV
GRANT DROP PROFILE TO DEV

можно изменять пользователя/схему

ALTER USER DEV IDENTIFIED BY NEWPASSWD;

ALTER USER DEV QUOTA UNLIMITED ON USERS;

понедельник, 4 сентября 2017 г.

Восстановление загрузки grub2

Грузимся с LiveCD, если есть lvm2 и они автоматически не подтянулись, активируем командой:
vgchange -a y

Если нет lvm модуля в LiveCD можно его установить:
apt-get install lvm2
modprobe dm-mod

Монтируем root
mount /dev/sda_х_ /mnt
и необходимые каталоги
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys

chroot /mnt
grub2-install /dev/sda

Lvm2 resize and Centos/Oracle

In Centos 7 / Oracle command:

resize2fs /dev/xxx/yyy
doesn't work with error
resize2fs: Bad magic number in super-block while trying to open /dev/xxx/yyy
Couldn't find valid filesystem superblock.
use

fasdm resize /dev/xxx/yyy

четверг, 31 августа 2017 г.

How to activate LVM2 on Live USB/CD

How to activate LVM2 on Live USB/CD

apt-get install lvm2
modprobe dm-mod
vgchange -a y