if($_ =~ /[a-zA-Z]+/ && $_ =~ /[0-9]+/)
$_ : the string in default variable
=~ : should match
a-zA-Z: lower case and uppercase
+ : more than once
&&: as well as
0-9: numbers
For some reason, could not connect access internet in CentOS, although my network shows connected.
$ nslookup google.com ;; connection timed out; no servers could be reached $ ping www.google.com ping: www.google.com: Name or service not known $ ping 8.8.8.8 From XX.XX.X.X icmp_seq=1 Destination Net Unreachable From XX.XX.X.X icmp_seq=2 Destination Net Unreachable From XX.XX.X.X icmp_seq=3 Destination Net Unreachable From XX.XX.X.X icmp_seq=4 Destination Net Unreachable
then, from an online post, I understand that
/etc/sysconfig/network should have following:
$ cat /etc/sysconfig/network
NETWORKING=yes
When I checked my
/etc/sysconfig/network, it was empty. Soon, I updated it with
NETWORKING=yes GATEWAY=XX.XX.X.X (filled with my IP address)and restarted my system again, which works now without problem!!
$ ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=27.6 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=39.6 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=117 time=29.8 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=117 time=62.9 ms 64 bytes from 8.8.8.8: icmp_seq=5 ttl=117 time=35.4 ms 64 bytes from 8.8.8.8: icmp_seq=6 ttl=117 time=18.7 ms ^C --- 8.8.8.8 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5009ms
$ cat list Pair1 Pair2 Pair3 Pair4
$ for d in $(cat list); do for i in $(cat list); do echo "$d $i"; done done | awk '$1 != $2' Pair1 Pair2 Pair1 Pair3 Pair1 Pair4 Pair2 Pair1 Pair2 Pair3 Pair2 Pair4 Pair3 Pair1 Pair3 Pair2 Pair3 Pair4 Pair4 Pair1 Pair4 Pair2 Pair4 Pair3
$ awk '/^>/ {if (sqlen){print sqlen}; print ;sqlen=0;next; } { sqlen = sqlen +length($0)}END{print sqlen}' db4_cdc_NDM_only.fasta | sed 's/>//g' | paste - - ref|NZ_CP029245.1| Escherichia_coli_strain_ECCRA-119_plasmid_pTB203,_complete_sequence 46161 ref|NZ_CP029386.1| Klebsiella_pneumoniae_subsp._pneumoniae_strain_SCKP040074_plasmid_pNDM6_040074,_complete_sequence 52989 ref|NZ_CP029731.1| Citrobacter_sp._CRE-46_strain_AR_0157_plasmid_unnamed3,_complete_sequence 108148 ref|NZ_CP029737.1| Providencia_rettgeri_strain_AR_0082_plasmid_unnamed,_complete_sequence 144970 ref|NZ_CP029978.1| Escherichia_coli_strain_51008369SK1_plasmid_p51008369SK1_E,_complete_sequence 99465 ref|NZ_KM923969.1| Acinetobacter_dijkshoorniae_strain_JVAP01_plasmid_pNDM-JVAP01,_complete_sequence 47268
$ pip install awscli
$ aws configure
AWS Access Key ID [None]: <enter the access key> AWS Secret Access Key [None]: <enter the secret access key> Default region name [None]: <enter region> Default output format [None]: <text>
$ aws s3 cp s3:URI <Local Desktop Location> $ aws s3 cp s3://qgen/MIX7341/WBB3097.gz ~/Desktop/AWS
$ aws s3 ls s3://qgen/MIX7341/ 2018-08-02 11:03:58 459407360 WBB3066.gz 2018-08-02 11:03:01 337848320 WBB3067.gz 2018-08-02 11:02:57 327219200 WBB3068.gz 2018-08-02 11:02:57 298680320 WBB3069.gz 2018-08-02 11:02:57 280514560 WBB3070.gz
$ aws s3 ls s3://qgen/MIX7341/ | awk '{print $NF}' >files_in_AWS.list ##step 1 $ for d in $(cat files_in_AWS.list); do echo $d; aws s3 cp s3://qgen/MIX7341/$d . ; done ##step 2
$ aws Traceback (most recent call last): File "/usr/bin/aws", line 19, in <module> import awscli.clidriver File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module> import botocore.session ImportError: No module named botocore.session
$ sudo pip install awscli --force-reinstall --upgrade Collecting awscli Using cached https://files.pythonhosted.org/packages/18/99/a1a1ea5a91161d5be5f434550ac1de800d79da7d4f68a5b5c8f265fcbd58/awscli-1.15.70-py2.py3-none-any.whl Collecting s3transfer<0.2.0,>=0.1.12 (from awscli) Using cached https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl Collecting colorama<=0.3.9,>=0.2.5 (from awscli) Using cached https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl Collecting rsa<=3.5.0,>=3.1.2 (from awscli) Using cached https://files.pythonhosted.org/packages/e1/ae/baedc9cb175552e95f3395c43055a6a5e125ae4d48a1d7a924baca83e92e/rsa-3.4.2-py2.py3-none-any.whl Collecting docutils>=0.10 (from awscli) Using cached https://files.pythonhosted.org/packages/50/09/c53398e0005b11f7ffb27b7aa720c617aba53be4fb4f4f3f06b9b5c60f28/docutils-0.14-py2-none-any.whl Collecting PyYAML<=3.13,>=3.10 (from awscli) Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB) 100% |████████████████████████████████| 276kB 2.8MB/s Collecting botocore==1.10.69 (from awscli) Using cached https://files.pythonhosted.org/packages/45/f3/0e5006bc6198213b853ca3975c537335a91716ffa1ed768e2b2ffe12d7ed/botocore-1.10.69-py2.py3-none-any.whl Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.12->awscli) Using cached https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli) Downloading https://files.pythonhosted.org/packages/d1/a1/7790cc85db38daa874f6a2e6308131b9953feb1367f2ae2d1123bb93a9f5/pyasn1-0.4.4-py2.py3-none-any.whl (72kB) 100% |████████████████████████████████| 81kB 3.5MB/s Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.10.69->awscli) Using cached https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore==1.10.69->awscli) Using cached https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.10.69->awscli) Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl Building wheels for collected packages: PyYAML Running setup.py bdist_wheel for PyYAML ... done Stored in directory: /root/.cache/pip/wheels/ad/da/0c/74eb680767247273e2cf2723482cb9c924fe70af57c334513f Successfully built PyYAML ipaclient 4.5.4 requires jinja2, which is not installed. rtslib-fb 2.1.63 has requirement pyudev>=0.16.1, but you'll have pyudev 0.15 which is incompatible. ipapython 4.5.4 has requirement dnspython>=1.15, but you'll have dnspython 1.12.0 which is incompatible. Installing collected packages: futures, jmespath, docutils, six, python-dateutil, botocore, s3transfer, colorama, pyasn1, rsa, PyYAML, awscli Found existing installation: futures 3.2.0 Uninstalling futures-3.2.0: Successfully uninstalled futures-3.2.0 Found existing installation: jmespath 0.9.3 Uninstalling jmespath-0.9.3: Successfully uninstalled jmespath-0.9.3 Found existing installation: docutils 0.14 Uninstalling docutils-0.14: Successfully uninstalled docutils-0.14 Found existing installation: six 1.9.0 Uninstalling six-1.9.0: Successfully uninstalled six-1.9.0 Found existing installation: python-dateutil 2.7.3 Uninstalling python-dateutil-2.7.3: Successfully uninstalled python-dateutil-2.7.3 Found existing installation: botocore 1.10.69 Uninstalling botocore-1.10.69: Successfully uninstalled botocore-1.10.69 Found existing installation: s3transfer 0.1.13 Uninstalling s3transfer-0.1.13: Successfully uninstalled s3transfer-0.1.13 Found existing installation: colorama 0.3.9 Uninstalling colorama-0.3.9: Successfully uninstalled colorama-0.3.9 Found existing installation: pyasn1 0.1.9 Uninstalling pyasn1-0.1.9: Successfully uninstalled pyasn1-0.1.9 Found existing installation: rsa 3.4.2 Uninstalling rsa-3.4.2: Successfully uninstalled rsa-3.4.2 Found existing installation: PyYAML 3.10 Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. $ aws usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: too few arguments
$ aws --version aws-cli/1.15.70 Python/2.7.5 Linux/3.10.0-693.17.1.el7.x86_64 botocore/1.10.69