Skip to content

Instantly share code, notes, and snippets.

View sidheimer's full-sized avatar

Sidharth Anand sidheimer

View GitHub Profile
@sidheimer
sidheimer / Sidharth_CLI_Drills_II.sh
Last active July 1, 2022 07:08
Sidharth_CLI_Drills_II
# CLI Drill 2
# ===== Pipes =====
# Question 1
echo "Downloading file..."
wget https://raw.githubusercontent.com/bobdeng/owlreader/master/ERead/assets/books/Harry%20Potter%20and%20the%20Goblet%20of%20Fire.txt 2> log.txt -O book.txt
# Question 2
echo -e "\n\nTop 3 lines"
head -n 3 book.txt
@sidheimer
sidheimer / Sidharth_CLI_Drills_I.sh
Last active June 29, 2022 09:30
Sidharth_CLI_Drills_I
# Question 1
mkdir hello
cd hello
mkdir five one
cd five
mkdir six
cd six
touch c.txt
mkdir seven
cd seven
@sidheimer
sidheimer / temperature.py
Created January 10, 2022 16:50
Python script to check current weather of a city from a terminal
#!/usr/bin/python
import json
import requests
import sys
def check_weather(city):
api_key = "34b68bf9f7b70bfa195f3b34c58573c1"
@sidheimer
sidheimer / script.sh
Created September 29, 2021 03:13
Script for changing linux file permissions in a directory
#!/bin/bash
echo "Changing permissions..."
for entry in "$search_dir"./*
do
if [[ "$entry" == *.sh ]]; then
continue
elif [[ -d $entry ]]; then
chmod 755 $entry