Fail Fast
Learn/React Faster
Do it Better
I find frustrating the way linux manage permissions and how to grant a folder permissions to upload file with winscp.
Now the best way I find to do that is:
1. create a group for a project folder and add users to it (this is not mandatory but a good way to work)
$ groupadd <group>
$ usermod -a -G <user> <group>
2. assign permission to folder to grant upload to ftp/winscp:
$ chmod o+rwx -R workfolder/ #This assign "others" rights to rwx, could be harmful in case of web application, be carefull!
$ chmod g+rwx -R workfolder/ #grant write to group
Command to recursively search into file with grep:
grep --include="*.prop*" -nRHI "<text>" * > filename.txt
How to change a password for user on a secured area proxied by ngnix:
sudo htpasswd /etc/nginx/.htpasswd
Nell'azienda dove lavor ci sono diverse persone in Pensione che lavorano ancora come consulenti.
La cosa non sarebbe grave se non si lamentassero per ogni cosa e se non pretendessero dall'azienda gli stessi servizi di quando erano dipendenti.
Gli abbiamo proposto di fare cambio: lui al lavoro e noi a casa con la sua pensione ma stranamente dicono no, è meglio la pensione...... Ma allora vai a casa lascia il posto a qualcuno !
list enabled service :
systemctl list-unit-files
enable awslogsd:
sudo systemctl enable awslogsd
Install ntp client
yum install ntpdate
modify /etc/ntp/step-tickers adding all the ntp server needed
ntpdate <ip_ntp_server> -> ntpdate 0.it.pool.ntp.org
systemctl restart ntpdate
systemctl enable ntpdate
check time with timedatctl
change timezone:
timedatectl list-timezonessudo timedatectl set-timezone your_time_zonesudo yum install gcc-c++
sudo yum install python3-devel
sudo yum install unixODBC-devel
sudo pip3 install pyodbc
These are the correct commands to install Pyodbc on AWS linux ami, note that is intended to install on a machine with both python2 and 3.
if you have only one version pip3 should become pip and
I've be working for a while into a Crystal report Java project.
The aim is to generate in background and email PDF files produced by Crystal report document, I built two projects on that one that generate over a http call the desired document and the second that runs every n minutes lookup the lines in a table and produce the related documents.
Everything works quite well in Eclipse but when you move in production on a linux machine there's come the rain.
The first error in the stack comes with these lines:
javax.imageio.spi.ImageReaderSpi: Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi could not be instantiated
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
So i'm started struggling to find if there's a missing library or not trying to repack the jar in different ways without success.
After a day (or more) spent and a very big headache, I scrolled down the log... saying to myself in case there's some other interesting information.... and taac here's the trick, the root cause is java.lang.IllegalArgumentException: vendorName == null!
Caused by: java.lang.IllegalArgumentException: vendorName == null!
at javax.imageio.spi.IIOServiceProvider.<init>(Unknown Source)
at javax.imageio.spi.ImageReaderWriterSpi.<init>(Unknown Source)
at javax.imageio.spi.ImageReaderSpi.<init>(Unknown Source)
at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi.<init>(CLibJPEGImageReaderSpi.java:80)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 99 more
This type of error handling is one of the thing that makes me hate java but on the other hand, i still love it, not easy language to learn but very powerfull and clean!
So, googling a bit I found some useful tips: https://stackoverflow.com/questions/7051603/jai-vendorname-null
https://thierrywasyl.wordpress.com/2009/07/24/jai-how-to-solve-vendorname-null-exception/
The solution is to add these lines in a manifest.mf file after the jar is produced, put that in the META-INF directory
Implementation-Vendor: Sun Microsystems, IncImplementation-Title: Java Runtime EnvironmentImplementation-Version: 1.6.0
>>> import re
>>> re.findall(r'\d+', 'hello 42 I\'m a 32 string 30')
['42', '32', '30']
>>> re.findall(r'\b\d+\b', 'he33llo 42 I\'m a 32 string 30')
['42', '32', '30']