This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-adusersid{ | |
#http://community.spiceworks.com/how_to/show/2776-powershell-sid-to-user-and-user-to-sid | |
param( | |
[string]$domain, | |
[string]$user | |
) | |
$objUser = New-Object System.Security.Principal.NTAccount("$domain", "$user") | |
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) | |
$strSID.Value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gmusicapi import Mobileclient | |
api = Mobileclient() | |
api.login('[email protected]', 'AppSpecificPassword') | |
all_gmusic_tracks = api.get_all_songs() | |
len(all_gmusic_tracks) | |
import csv | |
#https://unofficial-google-music-api.readthedocs.org/en/latest/reference/mobileclient.html?highlight=track#gmusicapi.clients.Mobileclient.get_all_songs | |
with open('c:\gmusictracks.csv', 'wb') as myfile: | |
fieldnames = ['artist', 'album', 'title'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://blogs.technet.com/b/heyscriptingguy/archive/2013/08/03/weekend-scripter-use-powershell-to-get-folder-sizes.aspx | |
Function Get-FolderSize{ | |
BEGIN{$fso = New-Object -comobject Scripting.FileSystemObject} | |
PROCESS{ | |
$path = $args[0] | |
$folder = $fso.GetFolder($path) | |
$size = $folder.size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Simple Redis init.d script conceived to work on Linux systems | |
# as it does use of the /proc filesystem. | |
### BEGIN INIT INFO | |
# Provides: redis_6379 | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
if exist "C:\Program Files (x86)\Trend Micro\OfficeScan\PCCSRV\Admin\Utility\VSEncrypt" set PATH="C:\Program Files (x86)\Trend Micro\OfficeScan\PCCSRV\Admin\Utility\VSEncrypt";%PATH% | |
del /f /d "C:\Program Files (x86)\Trend Micro\OfficeScan\PCCSRV\Admin\Utility\VSEncrypt\VSEncrypt.log" | |
cd "C:\Program Files (x86)\Trend Micro\OfficeScan\PCCSRV\Virus" | |
dir /b | |
set /p filetarget="File to decrypt? " | |
copy %filetarget% %filetarget%_encrypted >NUL | |
VSEncode.exe -d /f %filetarget% | |
more "C:\Program Files (x86)\Trend Micro\OfficeScan\PCCSRV\Admin\Utility\VSEncrypt\VSEncrypt.log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--- Lists local users in local Administrators group: --- | |
((get-wmiobject Win32_GroupUser -computer $computername | ` | |
where { ` | |
( $_.GroupComponent -like '*Administrators*' ) ` | |
-and | |
( $_.GroupComponent -notlike '*$((get-wmiobject win32_computersystem).domain.split('.')[0])*' ) ` | |
-and ` | |
( $_.PartComponent -like '*Win32_UserAccount*') ` | |
-and ` | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=p2p&archiveformat=gz | |
gunzip -c index.html* > level1.txt | |
ipset create LEVEL1 hash:ip hashsize 16777216 maxelem 16777216 | |
awk '!x[$0]++' level1.txt | pg2ipset - - LEVEL1 | ipset restore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function WhoIs(ByVal tRange As Range, ByVal tItem As String) As String | |
' http://www.mrexcel.com/forum/excel-questions/780655-doing-whois-excel.html | |
Dim xmlhttp As Object | |
Dim r, c As Integer | |
Dim t As String | |
r = tRange.Row | |
c = tRange.Column | |
ip = Cells(r, c).Text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/ | |
$connectionString = "Data Source=localhost\SQLEXPRESS;Integrated Security=false;Database=dbname;user id=sqluser;password=sqluserpassword;Connect Timeout=3;" | |
$sqlConn = new-object ("Data.SqlClient.SqlConnection") $connectionString | |
$sqlConn.Open() | |
$sqlcmd = New-Object System.Data.SqlClient.SqlCommand | |
$sqlcmd.connection = $sqlConn | |
$sqlcmd.commandtext = "SELECT * FROM information_schema.tables" | |
$sqlreader = $sqlcmd.ExecuteReader() | |
$table = new-object “System.Data.DataTable” | |
$table.Load($sqlreader) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#all taken from this kick ass post: https://p0w3rsh3ll.wordpress.com/2014/06/21/mount-and-dismount-volume-shadow-copies/ | |
Function Mount-VolumeShadowCopy { | |
<# | |
.SYNOPSIS | |
Mount a volume shadow copy. | |
.DESCRIPTION | |
Mount a volume shadow copy. | |