Skip to content

Instantly share code, notes, and snippets.

@Tharwat96
Tharwat96 / Errors.md
Last active July 4, 2020 16:43
Jenkins tips & tricks

In this file I will list stubborn errors encountered and their fix in order not to fall for them again and solve them fast

SSH Build keeps failing because of secret key authorization error.
  • Make sure to generate the keys using rsa encryption.
  • Make sure that both keys (pub and priv) are a pair.
  • Don't trust Jenkins connections check as it has some issues sometimes.
  • Try using different Jenkins version on your development env to make sure it is not a jenkins error.
@Tharwat96
Tharwat96 / rails_naming_conventions.md
Last active March 26, 2020 14:48 — forked from iangreenleaf/gist:b206d09c587e8fc6399e
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

# write/overwrite file
f = open("text.txt", "w")
f.write("bla bla")
f.close()
# search for something in file
with open('data') as f:
if 'test' in f.read():
@Tharwat96
Tharwat96 / editing text
Last active May 29, 2021 23:31
Linux commands that I keep forgetting
sed:
to substitute something with something else:
sed "s/something/something_else/g" file.sh
the g in the right is for changing all occurrences in all lines, if it was not written, only the first occurrence of each line is replaced
sed example to substitute new lines with spaces:
sed ':a;N;$!ba;s/\n/ /g' file