If you edit or create a file in windows and try to use it in Linux, we will have "\r\n" instead of "\n" at the EOL
to remove this error
sed -i 's/\r//g' good_wav.txt
tar -xf archive.tar.gz -C /home/linuxize/files
| git_current_branch () { | |
| local ref | |
| ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) | |
| local ret=$? | |
| if [[ $ret != 0 ]] | |
| then | |
| [[ $ret == 128 ]] && return | |
| ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
| fi | |
| echo ${ref#refs/heads/} |
| import boto3 | |
| import time | |
| import json | |
| import pprint | |
| import sys | |
| # Defaults | |
| query_output = 's3://platform-prd-my-athena-output-bucket/outputs' | |
| pp = pprint.PrettyPrinter(indent=2) | |
| queryparams = {} |
| import boto3 | |
| import pandas as pd | |
| import io | |
| import re | |
| import time | |
| params = { | |
| 'region': 'eu-central-1', | |
| 'database': 'databasename', | |
| 'bucket': 'your-bucket-name', |
| # Download ALL attachments from GMail | |
| # 1. Script needs to be run via console not in an IDE, getpass.getpass() will fail otherwise. | |
| # https://docs.python.org/2/library/getpass.html | |
| # 2. Make sure you have IMAP enabled in your GMail settings. | |
| # https://support.google.com/mail/troubleshooter/1668960?hl=en | |
| # 3. If you are using 2 step verification you may need an APP Password. | |
| # https://support.google.com/accounts/answer/185833 | |
| # 4. Reference information for GMail IMAP extension can be found here. | |
| # https://developers.google.com/gmail/imap_extensions |
| import email, getpass, imaplib, os | |
| detach_dir = '.' # directory where to save attachments (default: current) | |
| user = raw_input("Enter your GMail username:") | |
| pwd = getpass.getpass("Enter your password: ") | |
| # connecting to the gmail imap server | |
| m = imaplib.IMAP4_SSL("imap.gmail.com") | |
| m.login(user,pwd) | |
| m.select("cs2043") # here you a can choose a mail box like INBOX instead |
| # Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
| # Make sure you have IMAP enabled in your gmail settings. | |
| # Right now it won't download same file name twice even if their contents are different. | |
| import email | |
| import getpass, imaplib | |
| import os | |
| import sys | |
| detach_dir = '.' |