Skip to content

Instantly share code, notes, and snippets.

View hamdyaea's full-sized avatar
💭
Python 3 code writing and linux coding - software-coders.ch

Hamdy Abou El Anein hamdyaea

💭
Python 3 code writing and linux coding - software-coders.ch
View GitHub Profile
mytime=$(date -r flag-17-12-2020.flag +%s)
mytime2=$(date +$mytime -d "-5 min")
mytime3=$(date -u -d @${mytime2} +"%Y-%m-%d %H:%M:%S")
mystamp=$(date -r "/home/reporter/aws/traffic/$yesterday/$yesterday-trafficcensusaggregateids.tsv.gz" "+%Y%m%d%H%M")
echo $mystamp
}
#### send the file to the ftp ####
function send-file {
/usr/bin/ftp -inv $HOST <<EOF
user $USER $PASSWORD
cd $remote
lcd $localdir
mput $yesterday-trafficcensusaggregateids.tsv.gz
# initializing list
test_list = [1, 4, 5, 6, 4, 5, 6, 5, 4]
# printing original list
print("The original list : " + str(test_list))
# using list comprehension + zip() + slicing + enumerate()
# Split list into lists by particular value
size = len(test_list)
idx_list = [idx + 1 for idx, val in
# Python code to convert list of tuple into list
# Importing
import itertools
# List of tuple initialization
tuple = [(1, 2), (3, 4), (5, 6)]
# Using itertools
result = all(elem in list1 for elem in list2)
if result:
print("Yes, list1 contains all elements in list2")
else :
print("No, list1 does not contains all elements in list2"
mylist = [["hamdy","champion","hunter"],["Mininouille","chachat", "bebounet"],["ps5","xbox","fortnite"],["babou","xbox","mimoune"]]
for previous, current in zip(mylist, mylist[1:]):
if previous[1] == current[1]:
print(current[0])
@hamdyaea
hamdyaea / F2
Last active November 10, 2020 12:45
set pastetoggle=<F2>
à la fin :
autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE " transparent bg"
@hamdyaea
hamdyaea / gist:93fae7b5b055e8157aaee3a6662aef0a
Created December 28, 2019 17:44 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@hamdyaea
hamdyaea / robocopy_exclude_existing_files.cmd
Last active July 3, 2018 08:21 — forked from aromig/robocopy_exclude_existing_files.cmd
Robocopy - Exclude Existing Files
:: Developer : Hamdy Abou El Anein
robocopy c:\Sourcepath c:\Destpath /E /S /XC /XN /XO
:: /E makes Robocopy recursively copy subdirectories, including empty ones.
:: /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those.
:: /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those.
:: /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those.
:: With the Changed, Older, and Newer classes excluded, Robocopy will exclude files existing in the destination directory.