System Programming

40K

Solutions

19K

Contributors

Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Share tech news, updates, or what's on your mind.

Sign up to Post

Trying to accomplish the following, oBdA provided me with the process script, but I'd like to build on it.  If anyone can help, it would be greatly appreciated!

Have a powershell script that can be called from a vbscript and pass the parameter defined in the vbscript to the powershell script. In vbscript, I can call with this code, but not sure how to pass the parameter (computer) for example defined in vbscript...
'Set objShell = CreateObject("Wscript.Shell")
'Objshell.Run("powershell.exe -noexit .\test.ps1")

Open in new window

Powershell Script I'd like to do a few things:
• Check if the computer is online or offline.
• if computer is is offline, exit and send an email
• if the computer is online, run the below script that will check for running processes.
• if the below has anything other than return code 0 (meaning process is still running), have send email
• if the below has a return code of 0 (meaning no processing running), run an executable and invoke some SCCM commands.
 $computerName = 'RemoteMachine' ## Set to $null to run locally
$processList = @'
    "Name",             "Expected",     "Running"
    "cmd",              "1",            "0"
    "powershell",       "1",            "0"
    "OfficeClickToRun", "2",            "0"
'@ | ConvertFrom-Csv | ForEach-Object {$_.Expected = [int]$_.Expected; $_}

$splat = @{}
If ($computerName) {
    $splat['ComputerName'] = $computerName
    Write-Host "Testing processes on $($computerName)" -ForegroundColor Yellow

Open in new window

0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Hi,

   I have called third-party  api from main thread in c++ on linux which is working fine as expected. But, when I call same api from child thread, it's failing in multi threaded application.

   technically what could be the reason? (not interested to check with third-party people).

Thanks,
bvm
0
tried to intercept exttextoutw and tired of hangs

so coded a memory dumper but prices of financial quotes - unpropiable

untitled12.jpg
wanted to code superfast signaller to forex few years ago

and if autosubscribtion eats all my salary for this month - may be anybody helps me to fullfill my interest with valueable advices of methods how can I know prices in the exchange soft
0
Robocopy question

Currently I have a .bat file that uses robocopy to copy specific files from one folder to another.  Easy and it works just fine.

Issue now is the files are coming to us in multiple folders with date and timestamp.  What we need to is just copy the files within those folders to another location without copying the actual folders.

Current:

@Echo off

ROBOCOPY
D:\file1\file2\file3\
D:\destination\
*.XML
/MAXAGE:1

Again files were saved within folder "file3".  However, now there are multiple folders within "file3" and we need to pull just the files from within those subfolders but all the folders have different date and timestamps

Need:

@Echo off

ROBOCOPY
D:\file1\file2\file3\Folder_test_072519 (where date changes everyday)
D:\destination\
*.XML

Is there anyway to do this?
0
Hi,

  aws efs mounted (nfs 4) on rhel 7.4.  On my machine, I have ~10 mounts. How do I find whether it is efs mounted from us-east-1 or other mounts?  Is there any function or systemcall to find out from c or c++? Already tried with statvfs and statfs calls.

Thanks,
Bvm
0
What would you say are some of the best practices when it comes to securing your system(s) against dependencies (any you can think of) to enable continuous access and delivery to/of data.

Do we need to replicate things that much between servers/countries, what would be alternative approaches?

I am thinking in concepts of things like: security, cloud, blockchains, messaging and whatever you have in mind.
0
Hello all,

I hosting a hackathon event and I need some ideas for a t-shirt that will be given to the winning "crowd" favorite team. There are 1st, 2nd, and 3rd prizes (judged by an executive committee), but I added an additional award for all the participants to have their own say.

I need a t-shirt that is relevant to this group of Scala programmers. However, I am not immersed enough in coding and Scala to determine what isn't stupid/cheesy, but genuinely funny or "oh so true".

A few other facts that may give context:
- It a hard working group of about 200 developers
- Largely coding in Scala on Macs and Ubuntu  - WHAT? Scala is a rejected topic by EE??
- Our product is designed for the business enterprise market

Any suggestions are appreciated. They can be as actual t-shirt examples, a graphic, or a quote that I can use to make my own.

Thank you :)
0
Can anyone recommend a good book regarding the development of SaaS packages? Not from a technical standpoint, but more from an administrative/costs standpoint. And yes, I know I have posted a simple question to a very complex issue, but I am having to start somewhere.

Also, I am interested in anyone who wants to work on the project. It is basically a report generation project with a little math. The reasons for going SaaS are simple: (1) maintaining one piece of software; (2) not having to deal with multiple versions of the software; and (3) piracy.
0
Hi,

  compiling xerces on solaris box.
 
  /usr/lib/sparcv9/ and /usr/lib/64 have libicu*54.  
 
  In another location, /icu_needs_to_build_with/libicu*44.
 
  Whenver I compile, it's always picking libicu*54 version. I do want to build xerces with libicu*44 libraries.
 
  Do we have any flags like LDFLAGS or xyz to configure specific version shared libs?
 
 Thanks,
 Bvm.
0
Dear Experts, is there any tool or code which we can use to block some ports of applications. For example: someone inside LAN network can block the communication between Exchange servers and normal PCs?

Also, is there any tool/code which can be used to track the Internet access of VPN user?

And which tool should we use to mitigate it?

Many thanks!
0
Exploring ASP.NET Core: Fundamentals
LVL 13
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

visio 2013 standard does not show the "UML Sequence" template as shown below
https://www.youtube.com/watch?v=_xtZIDI8Ajg
only professional viso 2013 shows it?
are there existing sample diagrams which i can use as sample and modify on top of them easily?
any alternate tool to draw these type of diagrams easily apart from visio like free open source tools?
Please advise
0
In Enterprise Architect, how do you turn functional requirements into use cases?

I have tried to open the Relationship Matrix and then added use cases through it. But it seems like that is not the intended process.

The process I am looking for will be smooth.

I have requirements that I need to put into requirement groups. Then use cases I need to put into use case groups. The system is rather big.
Can you guide me to any example where EA is used and has the full tracebility of requirements to use cases, domain model, interfaces, and components?

I want to understand how to get from requirements to components, interfaces, and operations in EA
0
Hi Experts,
we have a site created in Caspio that has some required fields.
We realized that some of the required fields are coming thru w/o containing data.
So were told by Caspio that is probably due to those users using an old browser.
They created a field named user_agent that will capture which browser were used for each record data entry.
Now I created a list of all records with missing data in required field along with the data captured in this field named user_agent (browser).
See attached.
Wondering what are those values are and how can we sent a message informing this and this browser is not supported...
Thanks
Untitled.png
0
Hi

We need to regularly create system restore points on our user computers via command line.

The idea is to automate this process without deploying any 3rd party tools.

Step 1. Check if system restore is enabled on the computer. If it is not, enable it.
Step 2. Check the storage size allocated for system restore. If it is less than 6 GB, configure to to be 6 GB.
Step 3. Create a system restore point with a generic label e.g. "maintenance".
Step 4. Check if the system restore point got created or not by listing existing system restore points and comparing the labels with the generic label used in step3.


So this is the general idea of the script we want to create and I think I can do the other bits myself except for creating system restore point via command line.

I have tried the WMIC method, powershell method and everything else I can find on blogs and google search.

Most commands I run return the "execution successful" message.

But when I check manually if the system restore point got created or not by opening system restore GUI, I don't see the restore point created.

For the life of me I can't figure out what's going on.

So pls help !
0
Hi,
What can be reason to the below error, while it only happens when I deployed the same project to https (everything is fine if I deploy it to http)?

Server Error in '/RegRec2' Application.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.]
   System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper) +258
   System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +497
   System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +100
   System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection 

Open in new window

0
In short, I would say:

A flag is a predefined bit or bit sequence that holds a binary value.

A mode is a distinct setting.

So it's not always possible to replace the term "mode" by "flag". This is only possible if it's about a binary value. I got confused by these terms when reading:

http://man7.org/linux/man-pages/man2/open.2.html

The argument flags must include one of the following access modes:
O_RDONLY, O_WRONLY, or O_RDWR.

The file creation flags are O_CLOEXEC,
O_CREAT, O_DIRECTORY, O_EXCL, O_NOCTTY, O_NOFOLLOW, O_TMPFILE, and
O_TRUNC.

The file status flags are all of the remaining flags listed
below.

Why they just don't say:

The file access flags are O_RDONLY, O_WRONLY, and O_RDWR.

Why they suddenly use a different term when it's about "access"? Probably behind the scenes it's also just about a binary value, right? Probably all O_VARIABLE's above are 0 or 1.

And see: https://en.wikipedia.org/wiki/File_descriptor

This table records the mode with which the file (or other resource) has been opened: for reading, writing, appending, and possibly other modes.

So Wikipedia uses the term "mode" only (and not flag). At least they are consistent, because they call them all "modes".

Is there a specific reason why sometimes mode is used and something flag (while it's about the same thing)? I would stay, be at least consistent to avoid confusion.
0
By default, the first three rows of a "file descriptor table" consists of:

FD 0 (standard input,  associated with keyboard)
FD 1 (standard output, associated with screen)
FD 2 (standard error,  associated with screen)

Open in new window


These file descriptors point to one or more rows in the "open file table". Imagine we only have these three file descriptors. Then how does the "open file table" look like?

Usually all three file descriptors point to the same file, but that doesn't mean they point to the same entry in the "open file table". So how the open file table looks like?

_ | offset | reference count | permissions | flags | pointers
_ |    ?   |        ?        |      ?      |   ?
possible more rows

Open in new window


The lsof command shows for example:

lsof        721    root    0u      CHR              136,1       0t0          4 /dev/pts/1
lsof        721    root    1u      CHR              136,1       0t0          4 /dev/pts/1
lsof        721    root    2u      CHR              136,1       0t0          4 /dev/pts/1

Open in new window


The file "/dev/pts/1" is CHR (character special file). They all point to the same file.
I'm also wondering why it's for example "0u" and not "0r"? The file descriptor 0 stands for input, so it only has to read something.

r for read access;
w for write access;
u for read and write access;

Open in new window


I would expect something like: 0r, 1w, 2w instead of 0u, 1u, 2u? And what are the offsets et cetera?
0
hi,

i have script working.
When it runs it check for files and send email alert if not files and also if has files.
Currently it sending the email alerts text format.
Request experts help, want to send email with htm format.
and for errors it should bold the text and color RED.
can help...


#Requires -version 3.0
$WarningPreference="Continue"
function Send-Mail
{
  param (
    [string] $Email_Subject,
    [string] $Email_Body,
    [string] $Email_Attachment
  )
  Send-MailMessage -SmtpServer 'mailserver.com' `
  -Body $Email_Body `
  -From 'donotreply@mail.com' `
  -To 'admin@mail.com' `
  -Subject $Email_Subject `
  -Attachments $Email_Attachment
}
function Send-Error
{
  Write-Host "Sending Error Alert @ $emaildate"
  $subject = "ACTION REQUIRED : Error Alert @ $emaildate"
  $logcontents = get-content $Logfile | Out-String
  $Body = "Dear All,`n`nThis email sent by system for errors highlighted below."  + $logcontents + "`n Regards,`n Job Process"
  Send-Mail -Email_Subject $subject -Email_Body $Body -Email_Attachment $Logfile }
function send-status
{
  Write-Host "Sending Success Alert @ $emaildate"
  $subject = "INFO : Success Alert @ $emaildate"
  $logcontents = get-content $Logfile | Out-String
  $Body = "Dear All,`n`nThis email sent by system for your information"  + $logcontents + "`n Regards,`n Job Process"
  Send-Mail -Email_Subject $subject -Email_Body $Body -Email_Attachment $Logfile }

  #check if source files exists
0
I am trying ssh into a remote server, capturing the process ID, and stopping the app using the process ID.

For some reason I am loosing the value of the variable PROCESS in the SSH session,  all the logic works fine if i run it locally. Below is the code and the execution part where i am loosing the variable (PROCESS) Value. Can someone tell me why i am not able to capture the echo "$PROCESS" and $PROCESS below.

Stoptomcat()
{
. /apps/web/properties/tomcat.props
for server in "${dev_host_Array[@]}"
 do
        echo "connecting to the server $server" | tee -a /tmp/tomcat-App-operation.${now}.txt
        ssh -q "$server" bash -c "'
         PROCESS=`ps -ef | grep $app_name | grep -v "grep" | grep -v "Tom.sh" | awk '{print $2}'`
         echo "$PROCESS"
      if [ ! -x $PROCESS ]; then
         /apps/tomcat/$app_name/bin/catalina.sh stop | tee -a /tmp/tomcat-App-operation.${now}.txt &
         pid=$!
         declare -i elapsed=0
           while ps -p ${pid} >/dev/null; do
            sleep 1
             if ((++elapsed % 60 == 0)); then
               kill -9 $process
                exit
             fi
           done
  else
   echo " TOMCAT $app_name is already in stopped state"
fi
'"
done
}

Execution:

+ for server in '"${dev_host_Array[@]}"'
+ tee -a /tmp/tomcat-App-operation.1536692015.txt
+ echo 'connecting to the server testserver1'
connecting to the server testserver1
++ ps -ef
++ grep -v Tom.sh
++ awk '{print $2}'
++ grep …
0
Learn SQL Server Core 2016
LVL 13
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I have to migrate the FS GPFS (3.4) on AIX server on new NSD disks, under the current configuration.
Which replication procedure is best to use?

[root@crmcas01]/tmp# mmlsconfig
Configuration data for cluster TEST:
---------------------------------------------
myNodeConfigNumber 1
clusterName TEST
clusterId 13882357993337224079
autoload yes
minReleaseLevel 3.4.0.7
dmapiFileHandleSize 32
tiebreakerDisks tiebreaker01
worker1Threads 500
traceRecycle global
tracedevBufferSize 1048576
traceFileSize 300000000
trace all 4 tm 2 thread 1 mutex 1 vnode 5 ksvfs 2 klockl 2 io 3 pgalloc 1 mb 1 lock 2 fsck 3
pagepool 8G
nfsPrefetchStrategy 1
maxMBpS 2048
maxStatCache 256000
maxFilesToCache 64000
adminMode allToAll

File systems in cluster TEST:
--------------------------------------
/dev/SwReport
/dev/fsWBCp
/dev/fsCRMp
/dev/sbsiebCRMp
/dev/sbsiebgCRMp
0
Hi,
I have a requirement for an excel sheet to be formatted from a flat structure to a stacked structure. I'll try to explain:
In the flat structure has a number of basic columns, some of these columns repeat multiple times ('Transaction1', 'Transaction2', 'Transaction3'). some of the items will not have all transaction data, therefore some of those columns may be blank for a given item.

Example - https://imgur.com/B3h4Iir

I need to take this data structure and transform it in another sheet/workbook so it goes like this. The transaction is a single column with the transaction1,2,3 data repeating as row beneath the item, all other columns will remain blank. The next item will begin on the next available blank row.

Example - https://imgur.com/x8f2c4T

Thanks,
0
Hi Experts,
I got an invitation from someone to upload something to their google drive, however when I click on new button, the upload options are disabled and a message appears stating "you are working offline, and some functions are not avail.."
What is the cause and how can I change it?
Thanks in advance
0
How to use c4.5 classifier in android studio to process the  accelerometer and and gyroscope  sensor data from phone.
0
Dual pipe producer/consumer blocked by read.

The issue is in the producer:
        read(consumer_to_producer[0], &cnt, sizeof(cnt));
        read(consumer_to_producer[0], shared_arr, sizeof(shared_arr));

Open in new window

prevents the producer from working because the consumer has yet to write anything, how can I avoid this?


#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define SIZE 10

int shared_arr[SIZE];
int cnt = 0, in = 0, out = 0;
int consumer_to_producer[2], producer_to_consumer[2];

void consumer();
void producer();

int main() {
    pipe(consumer_to_producer); // consumer to producer
    pipe(producer_to_consumer); // producer to consumer

    if (fork() == 0) {
        /* child process */
        consumer();
    } else {
        /* parent process */
        producer();
        sleep(3);
    }

    exit(0);
}

void consumer() {
    /* consumer process */
    close(producer_to_consumer[1]); // Close write end, we don't need it
    close(consumer_to_producer[0]); // This fcn doesn't need read end
    while (1) { 
        /* if buffer is full, consume it */
        // read in cnt from producer so we can check if it's full
        read(producer_to_consumer[0], &cnt, sizeof(cnt));

        if (cnt == SIZE) { /* If full, consume */
            read(producer_to_consumer[0], shared_arr, sizeof(shared_arr));
            printf("I am consuming\t%d\t%d\n", shared_arr[in], out);
            out = (out + 1) % SIZE;
            cnt--;
        } 

        

Open in new window

0
In VBA while accessing Reference, error comes 'Error accessing the system Registry'

Your solution at the following webpage not found.
http://support.microsoft.com/default.aspx?scid=kb;en-us;269383

Please helo
0

System Programming

40K

Solutions

19K

Contributors

Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Top Experts In
System Programming
<
Monthly
>