EVERSYS s.r.o https://www.eversys.cz create, deploy, manage professionally Fri, 17 Dec 2021 23:30:42 +0000 cs hourly 1 https://wordpress.org/?v=6.7.1 https://i0.wp.com/www.eversys.cz/wp-content/uploads/2024/07/cropped-eversys_cube.png?fit=32%2C32&ssl=1 EVERSYS s.r.o https://www.eversys.cz 32 32 200936617 Heic soubory do jpg https://www.eversys.cz/index.php/2021/12/18/heic-soubory-do-jpg/ Fri, 17 Dec 2021 23:29:47 +0000 https://www.eversys.cz/?p=174 for file in *.heic; do heif-convert $file ${file/%.heic/.jpg}; done

]]>
174
Spustit příkaz jako jiný uživatel https://www.eversys.cz/index.php/2021/10/14/spustit-prikaz-jako-jiny-uzivatel/ Thu, 14 Oct 2021 09:04:42 +0000 https://www.eversys.cz/?p=169 sudo runuser -u www-data — php update.php

]]>
169
Externí adresa z commandline https://www.eversys.cz/index.php/2021/05/05/externi-adresa-z-commandline/ Wed, 05 May 2021 15:17:23 +0000 https://www.eversys.cz/?p=166 curl http://checkip.amazonaws.com

]]>
166
GITHUB bez hesla https://www.eversys.cz/index.php/2021/04/08/github-bez-hesla/ Thu, 08 Apr 2021 09:45:33 +0000 https://www.eversys.cz/?p=162 Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

$ ssh -T git@github.com
Hi developius! You've successfully authenticated, but GitHub does not provide shell access.

Change directory into the local clone of your repository (if you’re not already there) and run:

git remote set-url origin git@github.com:username/your-repository.git

Now try editing a file (try the README) and then do:

$ git commit -am "Update README.md"
$ git push

You should not be asked for a username or password. If it works, your SSH key is correctly configured.

]]>
162
Jak na Bearer tokeny v cURLu https://www.eversys.cz/index.php/2021/03/14/jak-na-bearer-tokeny-v-curlu/ Sun, 14 Mar 2021 13:29:36 +0000 https://www.eversys.cz/?p=157 Nejdříve stáhnout s login/password a s jq uložit
TOKEN=$(curl -s -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"username":"{username}","password":"{password}","rememberMe":false}' https://{hostname}/api/authenticate | jq -r '.id_token')

Předání Bearer tokenu do Authorization headeru

curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" https://{hostname}/api/myresource
]]>
157
Recover your MySQL password https://www.eversys.cz/index.php/2020/07/31/recover-your-mysql-password/ Fri, 31 Jul 2020 10:18:30 +0000 https://www.eversys.cz/?p=145

What if you’ve forgotten your MySQL root user password? This could be quite the predicament … had the developers not thought of that eventuality. In order to recover the password, you simply have to follow these steps:

  1. Stop the MySQL server process with the command sudo service mysql stop
  2. sudo mkdir /var/run/mysqld
  3. sudo chown mysql:mysql /var/run/mysqld
  4. Start the MySQL server with the command sudo mysqld_safe –skip-grant-tables –skip-networking &
  5. Connect to the MySQL server as the root user with the command mysql -u root

At this point, you need to issue the following MySQL commands to reset the root password:

mysql> use mysql;
​mysql> update user set authentication_string=password('NEWPASSWORD') where user='root';
​mysql> flush privileges;
​mysql> quit

]]>
145
Pár šikovných příkazů při obnově mysql dumpu https://www.eversys.cz/index.php/2020/07/30/par-sikovnych-prikazu-pri-obnove-transmed-dumpu/ Thu, 30 Jul 2020 12:21:19 +0000 https://www.eversys.cz/?p=143 Toto je důležité pro detekci kodování mysql --default-character-set=utf8 -h ddd -u zzz -p dbname < dump.sql Nahrazení řetězce v souboru: sed -i 's/old-text/new-text/g' input.txt Rozdělení na soubory: csplit -k bigfile.txt '/^DELETE/' {*} ]]> 143 Beep v linux shellu https://www.eversys.cz/index.php/2019/06/25/beep-v-linux-shellu/ Tue, 25 Jun 2019 20:39:30 +0000 https://www.eversys.cz/?p=89 Upozornění ze skriptu

( speaker-test -t sine -f 1000 )& pid=$! ; sleep 0.1s ; kill -9 $pid
]]>
89
Vytažení jedné tabulky z mysql dumpu https://www.eversys.cz/index.php/2019/03/18/vytazeni-jedne-tabulky-z-mysql-dumpu/ Mon, 18 Mar 2019 14:41:04 +0000 https://www.eversys.cz/?p=84 examplecom_wp_options.sql nebo z gzipu: zcat 2018-09-15_sk.sql.gz | sed -En ‚/DROP TABLE.*`nuke_users`/,/UNLOCK TABLES/p‘ > examplecom_wp_options.sql]]> sed -n -e ‚/DROP TABLE.*`wp_options`/,/UNLOCK TABLES/p‘ mysql_examplecom.sql > examplecom_wp_options.sql

nebo z gzipu:
zcat 2018-09-15_sk.sql.gz | sed -En ‚/DROP TABLE.*`nuke_users`/,/UNLOCK TABLES/p‘ > examplecom_wp_options.sql

]]>
84
Výmaz mnoha souborů https://www.eversys.cz/index.php/2017/09/13/vymaz-mnoha-souboru/ Wed, 13 Sep 2017 07:02:50 +0000 https://www.eversys.cz/?p=64 cd yourdirectory
perl -e 'for(<*>){((stat)[9]<(unlink))}'

]]>
64