From the command line /powershell type
C:\amroot >wsl -u root
This will launch Ubuntu as root user. Now to reset password for the user you forgot, execute the following command:
root@asifam:/mnt/c/asifam# passwd anynewpassword
That’s it. Now you should be able to download packages with updated password.
Ref: https://medium.com/@TheLittleNaruto/reset-wsl-password-609037c2d6c6
First we find out the line number of first occurrence of that search word
grep -n "About to submit message:GetHierarchyInfo:" inf72-MessageFactory3-paehowus200.std.log.20091028-0406 >> msgtimesofadb.log
we can read that file msgtimesofadb.log then use those line numbers
start of line in below example is 186625 , end line numbers 194625 contents will be pushed to msgcontent1.log
sed -n "186625,194625p;194625q" inf72-MessageFactory3-paehowus200.std.log.20091028-0406 >> msgcontent1.log
add this to bashrc or profile so every command is recorded with time stamp
HISTTIMEFORMAT="%Y-%m-%d %T "
clear
ctrl + l
reset
ls -ald /var/www
To allow user ec2-user (Amazon AWS) write access to the public web directory (/var/www/html),
enter this command via Putty or Terminal, as the root user sudo:
chown -R ec2-user /var/www/html
Make sure permissions on that entire folder were correct:
chmod -R 755 /var/www/html
>aws elasticbeanstalk list-available-solution-stacks --region eu-west-1 --profile devenv | grep "64bit.*Linux.*running Java 8" -m1
Configuration :
in settings Route Selection Expression : $request.body.action is mapped to lambda back end
e.g sendmessage to abcLambdaFunc and $default to xyzLambdaFunc
2 urls are generated
WSS URL for Websocket client to connect to API GW
Connection url for backends to communicate back to Websocket client
Below is example of command line client connecting to WSS URL
wscat needs to be installed :
MAC :
npm install -g wscat
Debian , Ubuntu , Kali Linux, Raspbian
apt-get install node-ws
wscat -c wss://<someid>.execute-api.<region>.amazonaws.com/<stage>
connected (press CTRL_C to quit)
>{"action":"sendmessage", "data": "some msg num 1 "}
< "response from backend: <connectionid> "
>{"action":"sendmessage", "data": "some msg num 12"}
< "response from backend: <connectionid> "
To set variable only for current shell:
VARNAME="my value"
To set it for current shell and all processes started from current shell:
export VARNAME="my value" # shorter, less portable version
To set it permanently for all future bash sessions add such line to your .bashrc file in your $HOME directory.
To set it permanently, and system wide (all users, all processes) add set variable in /etc/environment:
sudo -H gedit /etc/environment
This file only accepts variable assignments like:
VARNAME="my value"
Do not use the export keyword here.
You need to logout from current user and login again so environment variables changes take place.
For example in userdata:
echo "JAVA_HOME=/jdk1.8.0_172" >> /etc/environment
This would add the JAVA_HOME=/jdk1.8.0_172 line to that file. Note, you should not use export inside that file.
The PATH variable is likely already defined in the /etc/environment file and you'll need to overwrite that appropriately if you are going to append additional paths to it.
nc -w 5 -v dbqlosbap01.us.dns.com 9011
aws elasticbeanstalk list-available-solution-stacks --region eu-west-1 --profile devenv | grep "64bit.*Linux.*running Java 8" | head -1
aws s3 cp s3://dev-ems-root s3://dev-ems-root --recursive --profile devenv
aws s3 sync . s3://dev-ems-root --profile devenv
curl -i -H "Authorization: Basic bWljcm9zZXJ2aWNlOlBhc3N3b3JkMQ==" -X POST -d 'WTF' https://configserver.qa.es.aws.net/encrypt
sudo !!
ctrl+x+e
mkdir -p /mnt/ram
mount -t tmpfs tmpfs /mnt/ram -o size=8192M
ls -l
fc
ssh -L 3337:127.0.0.1:6379 root@emkc.org -N
mkdir -p folder/{sub1,sub2}/{sub1,sub2,sub3}
cat file | tee -a log | cat > /dev/null
disown -a && exit
sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
pip3 install CMake
sudo brew install boost
brew install boost
brew update
brew unlink git
brew install git
xcode-select --install
pip3 install face_recognition
face_recognition ./knownpeople/ ./unkownpeople/ | cut -d ',' -f2
face_recognition --cpus 4 ./knownpeople/ ./unkownpeople/ | cut -d ',' -f2
sudo python -m pip install Pillow
sudo pip3 --no-cache-dir install face_recognition
sudo pip2 --no-cache-dir install face_recognition
curl -H "Origin: http://example.com" --verbose http://domain/identity/v2/healthcheck/heartbeat;contextId=abc
curl -vL --header "Content-Type: application/json" \
--request POST \
--insecure \
--data '{"name":"xyz","email":"xyz", "message":"dkfjkdf"}' \
https://dev.api.gausiaacademy.org/v1/gacontactfrmlambda/contactus
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource
or posting data:
curl --data "param1=value1¶m2=value2" http://hostname/resource
For file upload:
curl --form "fileupload=@filename.txt" http://hostname/resource
RESTful HTTP Post:
curl -X POST -d @filename http://hostname/resource
For logging into a site (auth):
curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://localhost/Login curl -L -b headers http://localhost/
curl -v http://127.0.0.1:8080/secured/roles-allowed; echo
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /secured/roles-allowed HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Connection: keep-alive
< Content-Type: text/html;charset=UTF-8
< Content-Length: 14
< Date: Sun, 03 Mar 2019 16:32:34 GMT
<
* Connection #0 to host 127.0.0.1 left intact
Not authorized
Curl POST
curl -X POST "http://oauth-server/token?grant_type=client_credentials" \
-H "Accept: application/json" -H "Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ="
CURL Auth header
$ curl -H "Authorization: Bearer 60acf56d-9daf-49ba-b3be-7a423d9c7288" http://127.0.0.1:8080/secured/roles-allowed; echo
hello + client_id isSecure: false, authScheme: OAuth2
hostname -I
gets ip adderss of the machine
ls -l inf65-Message*20080410*
curl ifconfig.me
ifconfig
to get local ip info
ps -ef | grep java
ps -ef | grep logging
netstat -a | grep 8080
df -h
df -hT /home
curl -H "Origin: http://example.com" --verbose http://somain.com/idm/v2/healthcheck/heartbeat
1-You can either change the permission of the directory and enable others to create files inside.
sudo chmod -R 777 /home/sixven/camp_sms/inputs
This command will change the permission of the directory recursively and enable all other users to create/modify and delete files and directories inside.
2-You can change the owner ship of this directory and make user:francisco-vergara as the owner
sudo chown -R francisco-vergara:francisco-vergara /home/sixven/camp_sms/inputs
But like this the user:sixven can't write in this folder again and thus you may moving in a circular infinite loop.
So i advise you to use Option 1.
Or if this directory will be accessed by both users you can do the following trick:
change ownership of the directory to user:francisco-vergara and keep the group owner group:sixven.
sudo chown -R francisco-vergara /home/sixven/camp_sms/inputs
Like that both users can still use the directory.
But as I said you before It's easiest and more efficient to use option 1.
get thread Dump
ps -ef | grep java
get pid use that
kill -3 <pid>
* run top
* press Shift-H to enable Threads View
* get PID of the thread with highest CPU
* convert PID to HEX
* get stack dump of java process
* in stack dump look for thread with the matching HEX PID.
http://architects.dzone.com/articles/how-analyze-java-thread-dumps
to cut the file from line 219325 - 219327 of file inf64-MessageFactory1.std.log.20070405-0302
sed -n '219325,219327p;219327q' inf64-MessageFactory1.std.log.20070405-0302
sed -n '42192,42767p;42767q' inf64-MessageFactory1.std.log >> 1_MessageaFctory_1030-1040.log
grep -n "2007-04-16 09:37.*ThirdParty*" inf63-AuthorizationService.std.log
to set up java when install moved around
sudo update-alternatives --install “usr/bin/java” “java” “/opt/java/jdk1.7.0.21/bin/java” 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_21/bin/java
watch every second free memory watch -n <secs> <command>
watch -n 1 free -m
will hit with 100 requests , and 10 concurrent users on the url
ab -n 100 -c 10 -g out.txt "http://someurl"
ref: https://www.inmotionhosting.com/support/edu/wordpress/performance/stress-test-with-apachebench/
https://www.cyberciti.biz/faq/stress-test-linux-unix-server-with-stress-ng/
cat -v filename.sj to see/check format
r -ksh for last run command
history -40 will list last 40 commansds with l;ine numbers
r linenumber to run command from that line
esc + k - for back history commands
esc + j - fowd commands run list