Posts

Getting external facing IP

 * curl ifconfig.me

Generating your own certificate

* openssl req -newkey rsa:2048 -nodes -keyout myCompany.key -out myCompany.csr * openssl x509 -signkey myCompany.key -in myCompany.csr -req -days 365 -out myCompany.crt

Get versions of python modules installed

 pip freeze | egrep 'pandas|pandas_market_calendars' if you want to install a specific version: pip install pandas_market_calendars==4.5.1

ssh banners

 This command will output SSH banners from the server as pseudo-terminal is not allocated. #!/bin/bash ssh <user>@<server> << EOF echo 'hi A' EOF In order to remove the banner, we can either change the command as follows: #!/bin/bash ssh <user>@<server> 'exec bash' << EOF echo 'hi A' EOF or easiest way is  touch ~/.hushlogin

Zip file exploration

 in data exploration, when you have a lot of zip files, you need a way to look at the cotents with extracting each zip file. zcat file.log.zip | less unzip -p archive.zip file1.txt | less OR the best way vim archive.zip

VSCode (Not Visual Studio)

  Shortcuts: Ctrl+P - Open a file Ctrl+Alt+F - Search for a file in Explorer Extensions: Remote Explorer - SSH Git Lense - Git integration Data wrangler - Table view of data frames Zip Tools - Exploring zip files in a data set Windsurf / Codium - Auto Completion R-debugger via command line : install.packages("vscDebugger", repos = "https://manuelhentschel.r-universe.dev") # r-debugger vscode extension

Sending email from Python

 Can setup SMTP inside python itself but for better protection, setup sendmail with SMTP as in other post and then: More focused module :  def send_mail ( email , subject , body = "" , dataframe_dict = {}):     html_content = ""     for name , df in dataframe_dict .items():         html_content += f "<h3> { name } </h3>"         html_content += df .to_html( escape = False , classes = 'table table-striped' , table_id = 'dataframe' )         html_content += "<br><br>"     styled_html = f """     <html>     <body>         { body }         <br><br><br><br>         { html_content }     </body>     </html>     """     # Send HTML email using mail command     process = subprocess...