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
//https://stackoverflow.com/questions/9835553/how-to-backup-sql-database-programmatically-in-c-sharp | |
public class BackupService | |
{ | |
private readonly string _connectionString; | |
private readonly string _backupFolderFullPath; | |
private readonly string[] _systemDatabaseNames = { "master", "tempdb", "model", "msdb" }; | |
public BackupService(string connectionString, string backupFolderFullPath) | |
{ | |
_connectionString = connectionString; |
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
/* Takes a list ofdelimited strings, where the delimiter is intended to imply | |
* a hierarchy ( somewhat like a file system path ) and turns it into | |
* a tree-like structure consisting of nodes looking something like | |
* { name: "", children: [] } | |
* The tree starts at the root node, which is ( no foolin' ) called | |
* root. So the top (root) node is: | |
* { name: "root", children: [xxx] } | |
*/ | |
function listOfDelimitedStringsToTree(lines, delimiter){ | |
function stringTreeToObjectTree(root){ |
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
SELECT | |
@@SERVERNAME SERVERNAME, | |
CREATE_DATE 'INSTALALTIONDATE', | |
SERVERPROPERTY('EDITION') 'Version', | |
DATEADD(DD, 180, CREATE_DATE) AS 'EXPIRY DATE' | |
FROM SYS.SERVER_PRINCIPALS | |
WHERE SID = 0X010100000000000512000000 |
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
PrincipalContext adContext = new PrincipalContext(ContextType.Domain,"192.168.10.5"); //AD IP | |
adContext.ValidateCredentials("acton",<PASSWORD>); //returns bool |
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
File file = new File("C:\\audio\\stream-sample.wav"); | |
AudioInputStream audioInputStream = null; | |
try { | |
audioInputStream = AudioSystem.getAudioInputStream(file); | |
} catch (UnsupportedAudioFileException | IOException e) { | |
e.printStackTrace(); | |
} | |
AudioFormat format = audioInputStream.getFormat(); | |
long frames = audioInputStream.getFrameLength(); |
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
###### development tools | |
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk | |
### Python packages | |
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib | |
### pip packages | |
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython |
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
//setup | |
$.ajaxSetup({ | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); | |
// Actual ajax | |
$.post(submittarget,{data:data},function(e){ | |
console.log(e); | |
}); |
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
FFMPEG to transcode: | |
ffmpeg -codec:a libvo_aacenc -ar 44100 -ac 1 -codec:v libx264 -profile:v baseline -level 13 -b:v 2000k output.mp4 -i test.mp4 | |
MP4Box to segment: | |
MP4Box -dash 10000 -dash-profile live -segment-name output-seg output.mp4 |