File Signatures: How do I make sure that a Windows DLL isn't modified?

I once asked a question here if Windows DLLs are signed by Microsoft. I realized they were, and a good friend told me that the SigCheck utility can provide information about the signature of files; but a question remained: While SigCheck tells me if a file is signed, I need to be sure that Microsoft signed the file and no one else changed it later on. I mean, what if someone tampers the file, and then signs the file again (with the name of Microsoft on the signature, of course)? How can I be a

Converting binary file to Base64 string

I need to convert uploaded binary files to base64 string format on the fly. I'm using ASP, Vbscript. Using Midori's component for base64 conversion. For small size files (<20K) the performance is okay. But when it exceeds 75 or 100K, its totally lost. Is there any efficient way to convert big binary files (2MB) to base64 string format? Thanks in advance, Kenney

File sync or replication

What is the easiest way to sync or replicate files over a network? I am running a few servers in a rack for load balancing and wish to mirror content. For example, I have Server 1 where I do my FTP uploads to. Server 2 is another node. The manual way is for me to also do FTP uploads to Server 2 but I am sure it can be done automatically without my presence or without the user logged in. I have tried SyncToy but it just doesn't run when the user is not logged in. I have to manually run it. Are

How to remove files and directories quickly via terminal (bash shell)

From terminal window: When I use the rm command it can only remove files. When I use the rmdir command it only removes empty folders. If I have a directory nested with files and folders within folders with files and so on, is there any way to delete all the files and folders without all the strenuous command typing? If it makes a difference, I am using the mac bash shell from terminal, not Microsoft DOS or linux.

xsl:for-each file in directory(common solution)

I found solution for subj related to the Visual Studio XSLT processor: public class XsltListFilesExtension { public XPathNodeIterator ListFiles(string directoryPath) { XmlDocument doc = new XmlDocument(); doc.AppendChild(doc.CreateElement("files")); DirectoryInfo di = new DirectoryInfo(directoryPath); foreach (FileInfo fi in di.GetFiles()) { XmlElement file = doc.CreateElement("file");

Clean up my makefile fragment?

I'm using GNU Make to run scientific data analysis, where we have a bunch of Matlab scripts that ponder some input data and then spit out several files. It does this in a fairly complex way, so I've had to do some nasty Makefile tricks when trying to describe its function to Make. Here's an example: seg_cams_nozero := cam1 cam2 cam3 seg_per_camera := $(shell echo {,dyn_}{hands,obj{1,2,3,4,5}}.mat) # the complete list of things we want segmentation_outputs := $(foreach cam,$(seg_cams_nozero),$

File Why "@echo off" is not making a difference?

In a .bat file like this : @echo off start C:/my_test.exe Why the first line is making no difference ? I thought with "@echo off", it won't open the command window, but it still flashed and then closed, it has the same effect as without the first line. How to avoid the command window to open at all ? In other words, how to write the .bat file, so that when it runs, ONLY my exe file opens, the Windows command prompt window won't show up at all. I want the app to run at start up, so I was told

Implement Semi-Round-Robin file which can be expanded and saved on demand

Ok, that title is going to be a little bit confusing. Let me try to explain it a little bit better. I am building a logging program. The program will have 3 main states: Write to a round-robin buffer file, keeping only the last 10 minutes of data. Write to a buffer file, ignoring the time (record all data). Rename entire buffer file, and start a new one with the past 10 minutes of data (and change state to 1). Now, the use case is this. I have been experiencing some network bottlenecks

How to discover identical files without comparing them to eachother?

I am building a site where users can upload content. As always I aim for world dominance, so I would like to avoid storing the same file twice. For instance, if a user tries to upload the same file two times (by renaming or simply forgetting about what she has done in the past). My current approach is to have the database that tracks each uploaded file store the following information about each file: file size in bytes MD5 sum of file contents SHA1 sum of file contents And then a unique ind

Bash script to find directories on system contains > 1000 files?

I need a way of finding all the directories on a server that contain more than a set number of files (eg. 1000+). I work on many big servers, and sometimes find directories containing millions of small log files. I need a way to find these dirs. I was thinking something along the lines of scripting a full dir listing and then doing... ll | wc -l ...but thought there might be a better/quicker way to do it? I am ideally going to set this script to run in the crontab to run once a week. Cheers

Writing to a textfile in Matlab

I want to write out some data to a text file in Matlab but I am having problems. I want the file to look like this 'AnatomicImage:13' 'AnatomicImageNumber:13' 'ColorMapMaximum:20' 'ColorMapMinimum:0' 'SpectroscopySliceNumber:3' but it is getting written to the textfile like this AnatomicImage:13,AnatomicImageNumber:13,ColorMapMaximum:20,ColorMapMinimum:0,SpectroscopySliceNumber:3 I have included my code pat of which was borrowed from another post on Stackoverflow. AnatomicImage = 'Ana

File How do I check for pangrams in a line in ruby?

Some of you may notice I'm already back with the same painful code already. I'm not sure if the other question is still open or not once I accept an answer. Now the problem is a little simpler. I found some code that checked for pangrams. It use to be def pangram?('sentence') but I needed line to go in there so I tried changing it to def pangram?(line). It doesn't seem to mesh well with my coding style and doesn't work. I tried to use .contain('a' . . 'z') to check for a pangram but someone I k

WSO2 How to transform file

Now I have a local file just like : <userCode>001</userCode><productCode>001</productCode><Fee>1.00</Fee> <userCode>002</userCode><productCode>002</productCode><Fee>2.00</Fee> <userCode>003</userCode><productCode>003</productCode><Fee>3.00</Fee>; I need transform this file to : <Fee>1.00</Fee><productCode>001</productCode> <Fee>2.00</Fee><productC

Append a text to the end of multiple files in Linux

I need to append the following code to the end to all the php files in a directory and its sub directory: </div> <div id="preloader" style="display:none;position: absolute;top: 90px;margin-left: 265px;"> <img src="ajax-loader.gif"/> </div> I have tried with echo "my text" >> *.php But terminal showed the error: bash : *.php: ambiguous redirect What should I do. there are hundreds of files to add this code segment and it would be a real tough time adding it

SFTP to send file with bash script

I'm using key authentication, so password is not an issue. I have a file whose name I know and I simply want to send it to another machine over sftp. I tried searching but couldn't find this (seemingly simple) question anywhere. Perhaps my Google-fu is simply failing me today. In short: I'm on my local machine, want to send a file (test.txt) to a remote machine. Authorized keys are already provided. Basically I want to automate these three steps: sftp root@remote:/root/dropoff put test.tx

File MatLab - Execute functions base on their name

I have a couple of MatLab function, and almost all of them have a test function. There is not really a naming convention right now for test functions, so I end up with functions like test_functionName, tests_functionName, FunctionName_Test, etc. Howerver, I see two things these functions have in common : The name contains "test" (with different casing). They have no input or output parameters. I would like to write a function that would find, under a given folder (or in the PATH), all the f

File Batch high score script

I have made a memory game in batch and when you lose you submit your score which gets saved in a text file with your name, the points you got, and the date on one line. What i want to do is have all the entries in that file be ranged from highest point value to lowest. If i have to take away the date it's fine. Any suggestions? Thank-you in advance guys.

Unix - How to copy list of files from a remote machine

I have a list of files with no specific pattern on a unix machine. I want to copy these files from that machine to my local machine. For example, i have the list in a text file fileslist.txt a.txt b.txt c.txt d.txt Using this list, i want to copy from these files from the remote machine. What is the best possible way? As far as i know scp supports only wild card.

VBS Copying largest files first

I've been banging my head in this morning trying to solve a task I can't believe no one has wanted to do before - that being to copy a directory of files & subdirs & all files over to another location but strictly copying the BIGGEST files first. Why? Because, from what I can see, this will help stop fragmenting big files being copied to USB flash memory due to the way it seems to copy the file then move it, leaving a gap the size of the file. Bigger files can't fit in that gap so make t

wait for a file to be created

I have written a program in vbs and it should do the following. First of all it executes a program that I wrote in C++. At the end of that program a file is created. So I want my vbs script to wait until that program has finished and I tried to use this to wait for the file to be created. Set fso = CreateObject("Scripting.FileSystemObject") While (Not(fso.FileExists("D:\dev\FF\temp.asm"))) Wend Once this has happened it should execute a following program. Now I noticed that it is not really

How to ensure that a process reads file only when it is available in whole?

I have following requirement. One process (Process-1) reads from DB, gets the files and places the retrieved files, say in location /process1/data; and eventually places the files in /application/shared_data Second process (Process-2) will check the data from shared directory /application/shared_data. These two processes runs continuously, independent of each other. When Process-1 places a file, say from /process1/data to /application/shared_data; chances are that at the same time proc

Batch: Compare File Sizes

I have seen a few different ways to compare files, using COMP, FC and a few others, but what I need to do is a basic file size compare, and then do a local copy of the file if it is larger, to the network file. The files could be anything from 200kb and 5gb. So I am really only interested in the file size and not content. I would prefer a basic Dos script to run through a login script. Check local file A Check remote file B If file A is bigger than file B Copy B to A

FileTransfer is undefined in Cordova

I am working on Cordova tool in Visual studio. I want to download files via given url, So for that I have installed File and FileTransfer plugins in application. But it is giving me eror that, FileTransfer is undefined. I am writing it after device load. I read somewhere that I need to activate requestFileSystem first, so I have also tried this code, but fail. window.requestFileSystem(window.PERSISTENT, 0, function onFileSystemSuccess(fileSystem) { fileSystem.root.g

Write binary string in binary file Python 3.4

I tried to write binary data in string to binary file. My string contains only 0 and 1. I tried to do it in this way file = open('file.bin','wb') d = pack(str(len(code))+'s', bytes(code, 'UTF-8')) file.write(d) But i have only txt file. And no one HEX redactor see it correctly. What i am doing wrong? Python version 3.4 I have string which look like this 000101101100000000010010110000010011000000010010001000100000000000010111110000110100001100010001 Here is 96 0 and 1, line length alwa

Editing SWF or FLA files

I have one SWF file and i have few URLs inside, that i want to change. My question is how can i edit SWF file? Or when i decompiler it into FLA file, how can i edit it and compiler it againt back to SWF file? I decompiler it with Sothink SWF Decompiler, try to edit the FLA file with Adobe Flash Proffestional, but the program show me only images, without script.... So i have it in FLA file, but i have no idea how to edit it and how to compiler it again into SWF file. Can you please help me do it?

What happens (on Linux) if two programs open the same file for writing ("w+") and start writing?

I've had this question for a long time. Let's say at time t=0 sec program A opens file /data with "w+" flags. It wipes out /data clean and starts writing data to this file. Now let's say at time t=1 sec program B opens the same file /data with "w+" flags and starts writing data to this file. What the heck happens now? Program B aparently wipes /data clean and starts writing at the beginning, while program A has advanced and has a file position pointer pointing somewhere into the file. What

How can I get executable filename from core file in HPUX?

I couldn't find any answer for this question from yet. % uname -a HP-UX rx3600 B.11.31 U ia64 2782985371 In linux, I can get the filename from core dump file as below. "gserver" is the executable binary filename I'm looking for here. % file ./core.4837 ./core.4837: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from 'gserver --shared 1 --msgqkey=22581' But, I got a different output of "file" command in HPUX, which has no executable filename matching the co

File displaying pictures in a jsf page

I'm working on a web application using EJB (netbeans & glassfish server). I want to display pictures on my jsf page. These pictures are stored on my disk and I believe that my application cannot access the pictures using the absolute path. I've been looking for answers on the internet but i've not got a good result besides using servlets. Is there another way of doing it ?

How do I save a file name to a variable in cmd?

The purpose of this program is to search my music for a specific song and be able to play it from command line. I will later add code to control the music but for now I just want to be able to find the song and play it. I am using the '' so someone could enter "Another Brick in the Wall" and let it find "Another Brick in the Wall Part 2" The issue is when saving a variable, it can not use '' or they will be saved as part of the string.

How to decrease number in filename list by sed or similar tool

I have a list of files numbered in the filename, starting eg. at 013 (or another count) but want them renamed to start by 001. I don't mind the tool used (awk, sed, mv, tr, what-ever...) Example (before -> after): img013.tif -> img001.tif img014.tif -> img002.tif ... etc. Appreciate any help. 1000 x thanks, Roland

File WinScp - Difficulty with handling error values

i am trying to write a simple winscp script to use it inside a for loop, in a batch file. The loop is : for /F "tokens=2 delims==" %%s in ('set REMOTE_PATH[') do (" ECHO CHECKING FOR %%s winscp.exe /console /script=run01test1 /parameter // %%s IF %ERRORLEVEL% neq 0 ( ECHO FILE %%s DOES NOT EXIST CALL:error10 "76" "UNABLE TO LOCATE TARGET FILE %%s " CALL:ERRORNOTIFYMAIL "UNABLE TO LOCATE TARGET FILE %%s" "FATAL" "CHECK EXISTENCE OF TARGET DIRECTORY" "77" EXIT /B 10 ) ELSE (

I would like to password protect my .txt file

I would like to password protect my .txt file that has account names and passwords for my program. I know how to encrypt, but I want it to ask every time for a password. By the way, I am using windows. I preferably would not like to download a program however if it is the only option that is fine.

File What is the best way to implement Linux command diff using any java API?

I need to find the difference between two files in terms of lines. Lets say I have 2 files: file1.txt and file2.txt. File1 has the lines: LINE A LINE B LINE C File2 has the lines: LINE C LINE D LINE E Now lets say I want to find the difference between file2 and file1 (i.e (file2)-(file1) ). Then as my result I should be able to get: The lines that appeared in file2 but not in file 1. In my example this would be: LINE D and LINE E. The lines that appeared in file1 but not in file2. In m

File Skip first 2 rows when loading Table using sql loader

Currently my control file is as : Load data Infile '/.../../emp*.txt' Append into table emp_load When (emp_id <> 'emp_id') Fields terminated by "," optionally enclosed by ' " ' Trailing nullcols (Emp_id "TRIM(:EMP_ID)", EMP_NAME "TRIM(:EMP_NAME)", SAL "TRIM(:SAL)" ) Current input file : Emp_id,emp_name,sal 1,A,100 2,B,200 I now have another requirement where the input files wil contain 2 headers and will be like /folder1/folder2/file1_<date>.csv Emp_id,emp_name,sal 1,A, 100 2,

how can I parse a file adding a specific character based on coincidence?

I have a huge file like this: #bedGraph section chr1:0-1024000 1000 0 2000 0 3000 0.003902 4000 0.070963 ............. the raw #bedGraph section chr1:0-1024000 is repeated along the file, but change chr1 to chr2, chr3.... what I would like to add to this file is "chrom=chr1" if the raw has chr1, "chrom=chr2" if the raw has chr1.. so the final result should be: #bedGraph section chrom=chr1 chr1:0-1024000 As I am not a programmer, I would like to know if there is a fast & e

Looking for the best way to store files between two web applications running on docker

we have two symfony 4 application (web app & rest api) running on two different docker container on the same "real" server (for now). The files (like picture or documents) are stored in the web app public directory for the moment but we want to share this files to the rest api as well. What is the best way to share them ? Store them on the docker parent server ? Build a new web server for this files and access them by sftp ? We want to have all access (by the two app) on the new file sy

Unix awk pass variable as fileName

I am using the following command to split one file into two. currentCouponFile="$DIR/kozo_agency_current_coupon_ts-"$HMD_EFF_DT".csv" agencySpreadFile="$DIR/kozo_agency_spread_ts-"$HMD_EFF_DT".csv" awk -F '|' 'BEGIN{OFS=","};{$1=$1; if(NF == 2){print > "$currentCouponFile"}else{ print > "$agencySpreadFile"}}' $fileName Doing echo on currentCouponFile and agencySpreadFile gives me the desired filename. However the resultant file get created as $agencySpreadFile and $currentCouponFile.

File Malformed multipart body error : uploading to google drive

I tried file uploading to the drive via API and got the response 'Malformed multipart body'. (I tried to upload ipa and apk files) Function used for upload is given below: def upload_file_drive(folder_id, access_token, path, name): para = {"name": name, "parents": [folder_id]} headers = {'Authorization': 'Bearer ' + access_token} files = {'data': ('metadata', json.dumps(para), 'application/json; charset=UTF-8'), 'file': open(path, "rb")} response ="https://ww

TCL delete file

I use the below command to delete file in TCL. But it errors out, when the file does not exist. Am I correct to say the "nocomplain" will prevent it from erroring out? If not, what options, can I use to stop it from error out when file does not exist? eval file delete [glob nocomplain a.txt b.txt]

Alternative for ansible lookups as it always looks up files on localhost

I am running an ansible playbook inside a terraform local-exec provisioner with inline inventory of the remote instance IP. - name: Install git apt: name: git state: present update_cache: yes - name: Clone the git repository become_user: "{{ SSH_USER }}" git: repo: "{{ REPO_URL }}" dest: "{{ SRC_DIR }}" - name : Find files with .pub extension become_user: "{{ SSH_USER }}" find: paths: "{{ SRC_DIR }}" patter

File Why do you think when I upload images from my CF card to my computer some of the images are randomly corrupted?

It is very strange indeed. I've uploaded several times trying different techniques and I've never had this problem before. It is also very random. I've uploaded the same photos to different named folders to test out the randomness and one photo is ok one time and the next time it is a blue blob and corrupted. Super random. I tried my Uploading Program (Downloader Pro) (never had any problems before) and it seems like it corrupted more files then just uploading the files straight from the ca

Laravel 8 livewire file upload throws " The photo must be an image." error

I'm new here in Stackoverflow. Help me integrate ! Recently, I have learned Laravel 8. I tries upload in a Bootstrap Modal, it didn't work. It throws the above mentioned error. Then I followed the steps on " ". I copied and pasted exact code from that page in a freshly made livewire component. I got the same message ! Shouldn't that work at least? I chaecked my Storage folder. The first step of uploading the file to ~\storage\app\livew

  1    2   3   4   5   6  ... 下一页 最后一页 共 37 页