Christosoft Blog - Blogging about CrazyStat, phpLiteAdmin, PHP, webdevelopment, linux and server adm

Web Name: Christosoft Blog - Blogging about CrazyStat, phpLiteAdmin, PHP, webdevelopment, linux and server adm






Privacy Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: Cookie Policy You tried a dozen different howtos to change the root password of MySQL (5.7+) in a recent Ubuntu version (18.04+) and did not succeed? Like the one I posted in 2013?The reason these guides do not work is simple: root access through password is disabled and thus changing the password has no effect. You can find more details here.So how the heck can we access the database? On the console, you can login to MySQL as root without a password like this:If you need root access from another application, like phpMyAdmin, the best way is to add a new user like myroot that has all privileges and a password. To do so, login as root in the console (sudo mysql) and then create the new user like this (adjust new_password to something more secure):CREATE USER myroot @ localhost IDENTIFIED BY new_password GRANT ALL PRIVILEGES ON *.* TO myroot @ localhost WITH GRANT OPTION;CREATE USER myroot @ % IDENTIFIED BY new_passord GRANT ALL PRIVILEGES ON *.* TO myroot @ % WITH GRANT OPTION;FLUSH PRIVILEGES;QUIT;Now you can login from any application using the username myroot and the password new_password . On the console:I was using TeXworks 0.6.2 to edit LaTeX files under Ubuntu Linux 18.04 (using Gnome with X11). Suddenly, a file that I had edited before would always open in a strange way. The preview window with the PDF would open normally. But the editor opened maximized without a titlebar, window border etc. So there was no way to minimize the editor window.I tried to minimize the window using keyboard commands and the Window-Menu of the TeXworks editor. I managed to move the window to a different screen using keyboard commands, but still maximized without a titlebar. The window menu also did not work. Restarting TeXworks also did not help. Other files would open normally.I did not know that TexWorks stores window status information in aux-files. But it seems it does, as deleting these files solved the problem.If this tip saved your day, please drop a comment. This motivates me to keep writing these kind of posts.You have a certificate with a couple of alternative domain names added to it, but want to get rid of some of them while keeping others? The parameter --renew-with-new-domains is what you want. This is how you use it:certbot certonly --cert-name --renew-with-new-domains -d,, This will renew the certificate with the domains, and Any other domains that had been included in the certificate before will not be included in the new certificate. If you execute it like this, it will ask you for the verification method and parameters interactively. Alternatively, you can also configure this with parameters like -a webroot --webroot-path "/var/www/ .VLC for android is a good media player for Android. It comes with a sleep timer, which is useful if you are listening to audio books before sleep. However, for me, it always gets stuck after the sleep timer expired. This means the players notification still looks like it was playing. But neither the notification can be swiped away nor the application. So there is no easy way to close the app. Play buttons do not work and I cannot start another audio file. So the app is completely stuck.Check this option and when VLC is stuck, you can at least close the app by swiping it away.If this tip saved your day, please drop a comment below to keep me writing these kind of blog posts.For some time, I am using rspamd as Spamfilter. By the way, I can really recommend it over Spamassasin / Amavisd-new solutions. I configured rspamd to use a redis database for the bayes filter, neural network etc.Everything worked well until after some time, probably due to an update, it started spitting out Connection refused errors like these:2019-11-07 06:25:10 #32043(normal) rspamd_redis_stat_keys: cannot get keys to gather stat: Connection refused2019-11-07 06:25:15 #32042(normal) 4n3xhp lua; neural.lua:855: cannot get ANN data from key: rn_default_default_t66yaxz4_0; Connection refused2019-11-07 06:25:15 #32044(normal) 4n3xhp lua; neural.lua:1101: cannot get ANNs list from redis: Connection refused2019-11-07 06:25:15 #32040(controller) 4n3xhp lua; neural.lua:1135: cannot exec invalidate script in redis: Connection refusedNot every connection to redis failed, but quite a lot. This is a Debian Stretch system with a local redis 3.2.6 database and rspamd 2.1 running on the same host. So network problems couldn t be it. The redis logs did not even mention the failed connections, the MONITOR command of redis also did not show anything for the refused connections. Restarting redis didn t change anything, but restarting rspamd solved the problem for about an hour, when the problem started again. I tried adjusting the linux open files limit, the number of maximum redis connections and timeout settings without any luck.Finally, I found the setting that solved the problem. My redis configuration in /etc/rspamd/local.d/redis.conf had looked like this:The problem seems to be that localhost both resolves to an IPv4 address and an IPv6 address. Redis, however, is configured to only listen on the IPv4 address in /etc/redis/redis.conf:Rspamd seems to sometimes use the IPv4 address, which works, and sometimes the IPv6 address, which doesn t. This is why the problem seems to occur randomly.Hope this helps somebody to find the issue faster. If this saved your day, please drop a comment.I wrote a small PHP script to import a dozen csv files exported from Excel into a database. The CSV import basically looked like this:if (($handle = fopen($f, r )) !== FALSE) { while (($data = fgetcsv($handle, 1000, )) !== FALSE) { $date = DateTime::createFromFormat( d.m.Y , $data[0]); // Inserting this along with other data into a DB} ? And now what happened is that $date was false. So I fetched the errors like this:So I added var_dump($date), but it gave string(13) "31.01.2019", which looked right. But looking closely, the string length of 13 seems a bit long for a 10 character date, right? I tried trim() , but without luck. And then I remembered that I had a similar problem before where invisible empty space was due to the UTF-8 Byte Order Mark (BOM). This is a sequence of inivisible bytes at the beginning of a textfile that define in which unicode encoding the file is (UTF-8, UTF-16, ) and its endianess (big-endian or little-endian). Microsoft Office programs such as Excel or Word like to write this to the beginning of a file, but other programs may do so as well.if (($handle = fopen($f, r )) !== FALSE) { while (($data = fgetcsv($handle, 1000, )) !== FALSE) { if ($firstline and substr($data[0], 0, 3) === $bom) $data[0] = substr($data[0], 3); $firstline=false; $date = DateTime::createFromFormat( d.m.Y , $data[0]); // Inserting this along with other data into a DB} ? So this just checks whether the first three bytes in the file match the UTF-8 BOM added by Excel and in case it detects them, it remove these bytes. Now the date parses fine. If your file has a different BOM, e.g. for UTF-16, you may need to change the definition of $bom. Just check your file in a hex-editor to find the first three bytes. This is PSPad, a great text-editor that includes a HEX-editor:If this helped you to solve your problem faster, please drop a comment below. This motivates me to keep writing these articles. Hamburg hat als erste deutsche Stadt Fahrverbote für Diesel (Euro 4 und älter) eingeführt. Betroffen sind zunächst nur ca. 600 Meter der Max-Brauer-Allee und ca. 1,6km der Stresemannstraße. Wer mit seinem Euro 4 Diesel in Hamburg unterwegs ist, muss also den Umleitungsschildern folgen. Praktischer wäre es, wenn das Navi die gesperrten Straßen direkt von sich aus vermeiden würde. Ich habe mir die Eigenschaften der betroffenen Straßen in OpenStreeMap angesehen. Sie haben aktuell das Attribut mit dem Schlüssel motor_vehicle:conditional und dem Wert no @ (fuel=diesel), wie hier ein Abschnitt der Max-Brauer-Allee:Da die Daten also schon in OpenStreeMap vorliegen, kann man nun Navis, welche auf OpenStreetMap-Karten basieren, beibringen diese Straßen auf Wunsch zu umfahren.Ich habe mir die routing.xml von github heruntergeladen. Innerhalb des Routing-Profils für Autos (car) habe ich zunächst einen neuen Parameter eingefügt, mit dem man in der Oberfläche einstellen kann, ob Dieselfahrverbote gemeidet werden sollen oder nicht:Als nächstes muss definiert werden, was geschehen soll, wenn der Benutzer die Option aktiviert hat. Dazu habe ich folgende Regel eingefügt, welche die Straßen mit dem oben genannten Parameter meidet:Die angepasste routing.xml hier downloaden. Wie in der Datei selbst steht, muss man sie i.d.R. an eine der folgenden Orte ablegen:/sdcard/Android/data/ habe sie unter /storage/emulated/0/Android/data/ abgelegt, da dieser Ordner bei mir existierte. OsmAnd dann schließen (zur Seite wischen) und neu öffnen. Nun sollte in den Routingoptionen die neue Option erscheinen:Wenn man nun Routen innerhalb Hamburgs berechnet, die normalerweise die für Diesel gesperrten Routen nutzen würden, kann man sehen, dass es funktioniert. Hier eine Route, die beide Straßen nutzt:Aktiviert man nun die Option zum Meiden von Dieselfahrverboten, sieht die Route deutlich anders aus und meidet die gesperrten Straßen:Ab dem 01.01.2019 gelten nun auch großflächige Dieselfahrverbote in Stuttgart. Leider funktioniert dieser Ansatz (aktuell) nicht für Stuttgart. Er vermeidet Straßen, welche das oben genannte Attribut aufweisen. In Stuttgart sind aber nicht einzelne Straßen, sondern das gesamte Stadtgebiet (genauer: die ausgewiesene Umweltzone) gesperrt. Ich habe erst heute in OpenStreetMap die bereits vorhandene Markierung der Umweltzone mit dem obigen Attribut versehen. Bis dies in den OsmAnd-Karten landet, wird es noch bis zu einen Monat dauern (außer man hat das Karten-Abo). Da es sich bei der Stuttgarter Umweltzone aber um eine Fläche und keine Straße handelt, werden wahrscheinlich noch Anpassungen an der routing.xml nötig, damit OsmAnd die Dieselfahrverbote in Stuttgart berücksichtigen kann. Sobald es hierzu neues gibt, werde ich diesen Artikel aktualisieren. So if you are getting a Timeout when updating phpBB to 3.2.2, it tells you to either increase the maximum time limit or do the update on the CLI.How to update on the CLIOf course, this requires that you have access to the CLI.On the CLI, go into the install folder of phpBBCreate a file named config.yml that contains this:updater: type: db_onlyMake sure the above file does not end with newlinesphp ./phpbbcli.php update config.ymlIn my case, the CLI update gave this error:PHP Fatal error: Call to a member function fetch_array() on resource in [...]/install/update/new/phpbb/db/migration/data/v32x/fix_user_styles.php on line 42This is a bug in the migration script. The most easy way to fix it, is to go into your config.php and change the $dbms from mysql to mysqli. This is recommended anyway.If this is not possible for you, open the mentioned file and search for:$enabled_styles = $result- fetch_array();And replace this with:$enabled_styles = $this- db- sql_fetchrowset($result);Thanks to RMcGirr83 and Marc on this thread. When using the official third-party repository of mono in Debian, unattended Upgrades will not upgrade the mono packages unless you allow the origin. To do so, edit your /etc/apt/apt.conf.d/50unattended-upgrades , which may look like this:Unattended-Upgrade::Origins-Pattern { o=Debian,n=${distro_codename} o=Debian,n=${distro_codename}-updates o=Debian,n=${distro_codename}-proposed-updates o=Debian,n=${distro_codename},l=Debian-Security };To also update mono packages on Debian Stretch, add XamarinStretch as Origin:Unattended-Upgrade::Origins-Pattern { o=Debian,n=${distro_codename} o=Debian,n=${distro_codename}-updates o=Debian,n=${distro_codename}-proposed-updates o=Debian,n=${distro_codename},l=Debian-Security o=XamarinStretch };If you use another Debian version or Distribution, like Jessie or Ubuntu, search for the file /var/lib/apt/lists/download.mono-project.com_repo_*_InRelease and check the Origin: line and adjust the origin in the config file accordingly.Repositories with empty Origin like packages.sury.orgIf you find that the Origin of the packages in the repository is not given, then you can also tell unattended upgrade to select them based on the given site. For example, this works for the packages from Icinga repositoryThe Repository has the Origin debian icinga-stretch , so this is what you need to add to /etc/apt/apt.conf.d/50unattended-upgrades: o=debian icinga-${distro_codename} Test your changesTo test if it works, you can run unattended updates manually like this (as root or with sudo):unattended-upgrade -dIf this made your day or you still have problems, just drop a comment.

TAGS:about CrazyStat phpLiteAdmin 

<<< Thank you for your visit >>>

Blogging about CrazyStat, phpLiteAdmin, PHP, webdevelopment, linux and server administraton

Websites to related :
Home | Unixmen

  IntroductionWordPress is a famous content management system based on PHP and MySQL, distributed under the terms of the GNU GPLv2 (or later). In most..

Student Financial Aid - The Ohio

  Carousel content with 3 slides. A carousel is a rotating set of images, rotation stops on keyboard focus on carousel tab controls or hovering the mous

James Madison University Inter

  Welcome! International Students at James Madison University receive an unforgettable American ‭education.The University offers first-class teaching,

Israel National News | Israel's

  'Israel's outbreak one of the most severe in the world' 'We opened in a wild and uncontrolled fashion, the outbreak is now one of the most severe in t

Blender Artists Community

  Discussion about this site, its organization, how it works, and how we can improve it. Posts in this category will receive additional promotion on the

International university sports

  Send us a messageAt FISU, we always like to hear from the supporters and athletes inside the University Sport movement. Send us a message and we will

Welcome to the MTF Website

  Monitoring the Future is an ongoing study of the behaviors, attitudes, and values of Americans from adolescence through adulthood.Each year, a total o

Checkpoint Learning CPE for CPAs

  Try our new course finder for a personalized course list. My Recommended Courses > View All Courses An agent is not available at this time. Please tr

Mathematical Sciences | Michigan

  Solving Complex Problems Mathematical Sciences degree students undergo a rigorous curriculum in a vibrant environment for professional development and

GreenPath Financial Wellness Web

  Coronavirus (COVID-19): GreenPath is committed to the well-being of clients, staff, partners and community. Learn more. WE ARE HERE FOR YOU If you hav


Hot Websites