I'm trying to send a client to a URL on their accounting system for a specific account. The URL format is:
https://accountingsystem.com/Edit/CustomerEdit.aspx?CustomerId=MwA0ADEANQA4ADYAMgA=-MzQxNTg2Mg==
The Customer ID is 3415862, which when encoded as Base64, does indeed give me MzQxNTg2Mg==. However, I don't know where MwA0ADEANQA4ADYAMgA=- comes from, or how to calculate it. What's also confusing is this:
$ echo MwA0ADEANQA4ADYAMgA=-MzQxNTg2Mg== | base64 -D -d
<Info>: Read 34 bytes.
<Info>: Decoded to 14 bytes.
<Info>: Wrote 14 bytes.
3415862%
$ echo MwA0ADEANQA4ADYAMgA= | base64 -D -d
<Info>: Read 21 bytes.
<Info>: Decoded to 14 bytes.
<Info>: Wrote 14 bytes.
3415862%
$ echo MzQxNTg2Mg== | base64 -D -d
<Info>: Read 13 bytes.
<Info>: Decoded to 7 bytes.
<Info>: Wrote 7 bytes.
3415862%
Can someone elucidate this conundrum?
In anticipation,
J
There is a difference:
MwA0ADEANQA4ADYAMgA= decodes to hexadecimal 3300340031003500380036003200
and
MzQxNTg2Mg== decodes to hexadecimal 33343135383632
While both result to the string 3415862, the difference is that the first one is encoded from a UTF-16 string and the second one is encoded from UTF-8 or ASCII.
This said, I have no idea why they would combine both formats in one value. Maybe they just use the '-' sign to indicate that both formats are allowed.
Related
I am trying to run a tcpdump command with filesize 4096 but, it return with an error :-
tcpdump: invalid filesize
Command :- tcpdump -i any -nn -tttt -s0 -w %d-%m-%Y_%H:%M:%S:%s_hostname_ipv6.pcap -G 60 -C 4096 port 53
After some hit & trial I found that it's failing for filesize (4096 i.e 2^12) (8192 i.e. 2^13) and so on.
So, for filesize after 2^11 it's giving me invalid filesize error.
Can anybody tell me on which condition tcpdump return invalid filesize.
Also when I was running with Filesize :- 100000
tcpdump -i any -nn -tttt -s0 -w %d-%m-%Y_%H:%M:%S:%s_hostname_ipv6.pcap -G 60 -C 100000 port 53
.pcap file of max size 1.3GB was getting created.
I also tried looking in the source code of tcpdump but, couldn't find much.
I am trying to run a tcpdump command with filesize 4096
To quote a recent version of the tcpdump man page:
-C file_size
Before writing a raw packet to a savefile, check whether the
file is currently larger than file_size and, if so, close the
current savefile and open a new one. Savefiles after the first
savefile will have the name specified with the -w flag, with a
number after it, starting at 1 and continuing upward. The units
of file_size are millions of bytes (1,000,000 bytes, not
1,048,576 bytes).
So -C 4096 means a file size of 4096000000 bytes. That's a large file size and, in older versions of tcpdump, a file size that large (one bigger than 2147483647) isn't supported for the -C flag.
If you mean you want it to write out files that are 4K bytes in size, unfortunately tcpdump doesn't support that. This means it's past due to fix tcpdump issue 884 by merging tcpdump pull request 916 - I'll do that now, but that won't help you now.
Also when I was running with Filesize :- 100000
That's a file size of 100000000000, which is 100 gigabytes. Unfortunately, if you want a file size of 100000 bytes (100 kilobytes), again, the current minimum file size is 1 megabyte, so that's not supported.
I used lame for decoding from mp3 file to raw pcm file or encoding into mp3 from from raw pcm.
The question is When I use one test.0.pcm file, doing encoding and decoding over and over again(generating 0.mp3, 1.mp3,2.mp3, ... and test.1.pcm, test.2.pcm ....), although the size of for all .pcm files or all .mp3 files remain the same, but the contents are different. I tried to listen these audio files and found that 99.mp3's volume is much less than 1.mp3.
The script I use is like following:
#!/bin/bash
num=$1
last=0
now=1
for((i=0;i<num;i++));do
lame -r -b 64 -s 16000 -m m test.$last.pcm $last.mp3
lame --decode --mp3input -t -m m -s 16000 $last.mp3 test.$now.pcm
last=$now
now=$[now+1]
done
The original test.0.pcm has only 1 channel and sampling freq is 16k.
Some logs are like following, they are all same except for Replay Gain:
input: 97.mp3 (16 kHz, 1 channel, MPEG-2 Layer III)
output: test.98.pcm (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
skipping final 47 samples (encoder padding-decoder delay)
Frame# 49/49 64 kbps
Assuming raw pcm input file
LAME 3.100 64bits (http://lame.sf.net)
polyphase lowpass filter disabled
Encoding test.98.pcm to 98.mp3
Encoding as 16 kHz single-ch MPEG-2 Layer III (4x) 64 kbps qval=3
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
49/49 (100%)| 0:00/ 0:00| 0:00/ 0:00| 88.200x| 0:00
----------------------------------------------------------------------------------------------------------
kbps mono % long %
64.0 100.0 100.0
Writing LAME Tag...done
ReplayGain: +46.1dB
Noticing ReplayGain is increasing constantly but I have no knowledge about mp3 encoding method, so I am not sure if this is the reason.
MP3 is a lossy codec. You're going to lose quality each time you encode another generation.
E.g., I type ping www.domain.com and the output I want is like:
64 bytes from yyy.xxx.com (www.domain.com): icmp_seq=32 ttl=52 time=84.8 ms
(or other format with domain name).
Not possible by any flag ping command provides.
But we always can roll up our sleeves and get hands dirty.
ping google.com | sed -e 's/\([[:digit:]]*\+\:\)/\1 (google.com)/g'
Considering output format includes something like that "64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.397 ms" we can try to parse with sed.
So, sed looks for digit and ":" symbol afterwards, replaces it to "digit: (google.com)".
I am trying to find a call function in a binary file, so I tried this:
Compile my code (in C),
Use the command: mips-mti-linux-gnu-objdump -d myapp.elf> objdump.txt
My function in objdump.txt file: 9d003350: 42000828 myfunction 0x1
Now, I want to identify this function in myapp.bin when reading this from memory. But, I get this: 28080042.
I tried to use the command: xxd -ps myapp.bin> xxd.txt
Just can find: 28080042.
Is it possible to do that?
That's an endianness conflict. objdump and xxd are giving you the same bytes, they're just using different endianness.
Actual bytes in order:
28 08 00 42
Big endian value:
28 08 00 42
Little endian value:
42 00 08 28
xxd -p will print out the individual bytes in the file in the order in which they exist.
objdump is disassembling it, it knows that the bytes belong in groups of 4, and it's interpreting them as little-endian.
xxd can print in little-endian order, using the -e flag (with a default grouping of 4 bytes, use the -g flag to change the number of bytes per group). However, this is incompatible with the -p flag, because the -p flag ignores any grouping.
objdump can be made to print in big-endian order, using the -EB flag, however, this will affect what instructions it reports.
I am calling SQL*Plus from Linux C Shell:
sqlplus username/password #file.sql var1 var2 var3
If I pass a string as var1, how long can this string be?
Is it governed by the OS? In this case:
Linux version 2.6.9-100.ELsmp (mockbuild#x86-010.build.bos.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 SMP Tue Feb 1 12:17:32 EST 2011
Update: Empirical testing yielded the following results:
A command line argument of 5200 characters gave the error, "Word too long."
1300 characters then produced the SQL*Plus error, "string beginning "(000796384..." is too long. maximum size is 239 characters."
As soon as I got under 239 chars all was well.
I think I'll use sqlldr to overcome this.
Try with: xargs --show-limits </dev/null
Your environment variables take up 2446 bytes
POSIX upper limit on argument length (this system): 2092658
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2090212
Size of command buffer we are actually using: 131072
There is no limit per argument, but a total for the whole command line length. In my system (Fedora 15/zsh) its closer to 2Mb. (line 4).
I came across "How long an argument list your kernel can take on the command line before it chokes?":
getconf ARG_MAX
which gives the following on my system:
131072