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
| /* | |
| * This file is part of SmartSNMP | |
| * Copyright (C) 2014, Credo Semiconductor Inc. | |
| * | |
| * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation; either version 2 of the License, or | |
| * (at your option) any later version. | |
| * | |
| * This program is distributed in the hope that it will be useful, |
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
| #include <windows.h> | |
| #pragma comment(lib, "advapi32.lib") | |
| BOOL ShutdownSystem(LPTSTR lpMsg){ | |
| HANDLE hToken; // handle to process token | |
| TOKEN_PRIVILEGES tkp; // pointer to token structure | |
| BOOL fResult; // system shutdown flag | |
| // Get the current process token handle so we can get shutdown |
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
| #include <Windows.h> | |
| int _tmain(int argc, _TCHAR* argv[]) | |
| { | |
| HANDLE hToken; | |
| OpenProcessToken(GetCurrentProcess(), | |
| TOKEN_ADJUST_PRIVILEGES | | |
| TOKEN_QUERY, | |
| &hToken); |
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
| " ------------------------------ | |
| " Name: vimrc for windows | |
| " Author: keelii | |
| " Email: [email protected] | |
| " ------------------------------ | |
| " Startup {{{ | |
| filetype indent plugin on | |
| augroup vimrcEx |
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
| #!/usr/bin/python | |
| # versao.py – captura e mostra a versão do MySQL database server. | |
| # importe os modulos do MySQLdb e sys | |
| import MySQLdb | |
| import sys | |
| # Abra uma conexão com o banco de dados | |
| # Tenha certeza de ter trocado o IP, usuario, senha e database para os seus. | |
| connection = MySQLdb.connect (host = “192.168.1.1″, user = “username”, passwd = “password”, db = “database_name”) | |
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 datetime import datetime | |
| import hashlib | |
| import MySQLdb | |
| conn = MySQLdb.connect (host = "localhost", user = "root", passwd = '',db = "spider",charset = 'utf8') | |
| cursor = conn.cursor () | |
| #INSERTION/UPDATE Statements | |
| sql="insert ignore into url_queue select * from something" | |
| cursor.execute(sql) | |
| conn.commit() |