Skip to content

Instantly share code, notes, and snippets.

#Author: Arockia
"""Use this script to monitor the price of products from Amazon and get alert when there is a fall in price."""
import urllib, requests, codecs, datetime, os,smtplib
from email.mime.text import MIMEText
import BeautifulSoup
filename="ProductPriceHistory.txt"
#!/usr/env/ python
#Author: Arockia
"""Use this script to monitor the price of products from Amazon and get alert when there is a fall in price."""
import urllib, requests, codecs, datetime, os
from bs4 import BeautifulSoup
filename="ProductPriceHistory.txt"
#Get Logical Parition usage in percentage
#Written by Arockia
Get-WmiObject win32_logicaldisk -Filter "DriveType=3" | select DeviceID,Size,Freespace | Format-Table -Property DeviceID,@{name="Total_Space";expression={[math]::Round(($_.Size/1MB)/1024,2).ToString()+" GB"}},@{name="Free_Space";expression={[math]::Round(($_.Freespace/1MB)/1024,2).ToString()+" GB"}}, @{name="Usage Percentage";expression={[math]::Round(((([math]::Round(($_.Size/1MB)/1024,2)-[math]::Round(($_.Freespace/1MB)/1024,2))/[math]::Round(($_.Size/1MB)/1024,2))*100),2).ToString()+" %"}} -AutoSize
@ArockiaAntony
ArockiaAntony / list_ad.ps1
Created January 27, 2016 12:31
Scripts for Website
Import-Module ActiveDirectory
$days = 7
$users = Search-ADAccount -AccountExpiring -TimeSpan (New-TimeSpan -Days $days)
$op=""
foreach($usr in $users)
{
$current_user = Get-ADUser $usr.SamAccountName -Properties Manager,mail,userprincipalname,AccountExpires,DisplayName
if ($current_user.userprincipalname -ne $null)
{
$user_mail = $current_user.userprincipalname
@ArockiaAntony
ArockiaAntony / system_notify.py
Last active January 27, 2016 12:24
Scripts for Website
import requests
from bs4 import BeautifulSoup
import subprocess
import threading
import pynotify
import sys
top_stories_url=“http://timesofindia.indiatimes.com/”
top_stories_req = requests.get(top_stories_url)
#!/bin/sh
cd /usr/local/share
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-i686.tar.bz2
tar -xjf /usr/local/share/phantomjs-1.9.0-linux-i686.tar.bz2
sudo ln -sf /usr/local/share/phantomjs-1.9.0-linux-i686/bin/phantomjs /usr/local/bin/phantomjs
git clone git://github.com/n1k0/casperjs.git /usr/local/src/casperjs
cd /usr/local/src/casperjs
git checkout tags/1.0.2
ln -sf /usr/local/src/casperjs/bin/casperjs /usr/local/bin/casperjs