Skip to content

Instantly share code, notes, and snippets.

View countnazgul's full-sized avatar

Stefan Stoichev countnazgul

View GitHub Profile
@countnazgul
countnazgul / engine_ref__all_engine_error_codes.js
Last active October 10, 2023 13:46 — forked from theredpea/engine_ref__all_engine_error_codes.js
[Engine error codes] #qlik #qliksense #engine #enigma.js
var engine_js = {
"ErrorCode.-128": "Internal engine error",
"ErrorCode.-1": "Unknown error",
"ErrorCode.0": "Unknown error",
"ErrorCode.1": "Some data is not correctly specified.",
"ErrorCode.2": "The resource could not be found.",
"ErrorCode.3": "Resource already exists.",
"ErrorCode.4": "Invalid path",
"ErrorCode.5": "Access is denied",
"ErrorCode.6": "The system is out of memory.",
@countnazgul
countnazgul / qv-no-header-to-csv.qvs
Last active April 17, 2022 18:54
[Save table without headers] #qlik #qlikview #qliksense #script
// Save QV table without the headers (or at least without the original headers)
set vNH_SourceTable = Data; // which QV table need to be exported
set vNH_OutputFile = C:\Users\adm-s7729841\Desktop\Headerless.csv; //the path to the result csv/txt file
Qualify *;
Headers:
First 1
Load
*
Resident
@countnazgul
countnazgul / psftp_automate_sftp_server.bat
Last active April 17, 2022 18:54
[psftp run commands from file] #psftp #ftp #terminal
psftp username@sftp.server.com -pw password -b commands.txt
commands.txt contain all the psft commands that need to be executed like:
lcd c:\test
mget *.gz
@countnazgul
countnazgul / Limit number of MongoDB query.js
Last active April 17, 2022 18:54
[Limit number of returned docs] Limit number of MongoDB query #mongo #mongoose
Posts
.find({})
.sort({})
.limit(5)
.exec(function(err, posts) {
console.log(posts)
});
@countnazgul
countnazgul / Mongoose filter fields.js
Last active April 17, 2022 18:54
[Filter specific fields in query] #mongo #mongoose
User.find({}, 'first last', function (err, usr) {
//Got the result, saved a few bytes of code
});
@countnazgul
countnazgul / Update All.js
Last active April 17, 2022 18:53
[Update all rows in MongoDB] #mongo
Model.update({ }, { $set: { status: 'active' }}, { multi: true }, function(err, numAffected) {
console.log(numAffected);
});
@countnazgul
countnazgul / asp.net-active-directory-group-details.cs
Last active April 17, 2022 18:53
[Get details for Active Directory group] #csharp #asp.net
// add reference to System.DirectoryServices.AccountManagement
// using System.DirectoryServices.AccountManagement;
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
GroupPrincipal group = GroupPrincipal.FindByIdentity(ctx, "domain\\groupname");
var users = group.GetMembers();
if (group != null)
{
@countnazgul
countnazgul / qlikview-c-create-task.cs
Last active April 17, 2022 18:52
[Create reload task] Create new reload task with QlikView management API #qlik #qlikview #csharp
private void CreateTask(string user)
{
QMSClient Client;
string QMS = "http://localhost:4799/QMS/Service";
Client = new QMSClient("BasicHttpBinding_IQMS", QMS);
string key = Client.GetTimeLimitedServiceKey();
ServiceKeyClientMessageInspector.ServiceKey = key;
Client.ClearQVSCache(QVSCacheObjects.UserDocumentList);
@countnazgul
countnazgul / MS-DOS delete folder silently.bat
Last active April 17, 2022 18:51
[MS-DOS delete folder silently (without Y/N prompt)] #terminal
rmdir /S /Q c:\temp
@countnazgul
countnazgul / Loop_through_all_files_in_current_folder.bat
Last active April 17, 2022 18:51
[Loop through all files in current folder] #terminal
for /r %%i in (*.txt) do echo %%i