-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd.sh
More file actions
861 lines (642 loc) · 21.9 KB
/
Copy pathcmd.sh
File metadata and controls
861 lines (642 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
#===================================
Apache:
wget http://mirrors.dcarsat.com.ar/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
tar xvfz apache-maven-3.5.2-bin.tar.gz
Add apache-maven-3.5.2/bin/ to PATH in ~/.bashrc
export PATH=$PATH:apache-maven-3.5.2/bin/
. ~/.bashrc
Check Java installation anf JAVA_HOME variable
#==================================
bash
#==================================
BATCH
ren 2015* 2016*
#===================================
building command:
ln -s source target
echo "hi" &> file
echo "hi" | tee file
ls -lrtha
df -h
du -s
whoami
whereis package
which program
echo $?
echo "hi" > /dev/null
cat /proc/meminfo
cat /proc/cpuinfo
> file
history | less
history | grep <word>
history -d <line>
jobs
ctrl +z
fg job_id
bg job_id
command &
top
ps aux | grep <pid> / <word>
diff file1 file2
file <filename>
stat <filename>
type <filename>
man command
dos2unix
> file
touch file
clear
tar -xvfz checkinstall_1.6.2-4.debian.tar.gz
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
date
mkdir -p
kill -9 PID
netstat -lx
https://www.linux-party.com/29-internet/8969-20-comandos-netstat-para-administradores-de-redes-linux
ipconfig TODO complete virtual interfaces
source
bash
sudo su
chmod 755 +- x +-r
chown user file
sudo adduser intel
sudo adduser intel sudo
ssh-keygen -t rsa -b 4096 -v
grep -rl 'output_count' ./ | xargs sed -i 's/output_count/amount_output_kvertices/g' isExpandsNkvertices.py
grep -rl 'windows' ./ | xargs sed -i 's/windows/linux/g'
perl -p -i -e 's/\/home\/andres\/HPC\/En_Mendieta/archivos_grads\/home\/alighezzolo\/conae/\/gcc\/gradsfiles\/meteogramas/g' *.gs
perl -p -i -e 's/\/home\/andres\/HPC\/En_Mendieta\/archivos_grads/\/home\/alighezzolo\/conae\/gcc\/gradsfiles/g' *.gs
perl -p -i -e 's/\/home\/alighezzolo\/conae\/gcc\/gradsfiles/\./g' *.gs
perl -p -i -e 's/archivos_grads/gradsfiles/g' *.gs
CHequear dejo de funcionar
perl -p -i -e 's/wrfout_d01_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}:[0-9]{2}:[0-9]{2}/wrfout_d01_$ENV{ACTUAL_START_DATE}/g' namelist.ARWpost
md5sum apache-cassandra-3.7-bin.tar.gz | grep 39968c48cbb2a333e525f852db59fb48
sudo netstat -plnt
grep -rl "Spluk" * -R | xargs sed -i 's/Spluk/Splunk/g'
grep Spluk -r .
#==================================
CASSANDRA
cd apache-cassandra-3.7/bin/ cd /opt/cassandra/bin (para int)
./cqlsh
cqlsh> use cassandra ;
cqlsh> drop keyspace cassandra; case_mgmt(para int)
cqlsh> exit
#=================================
CORS
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.webtoolkitonline.com' is therefore not allowed access.
Add this policy in apigee
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="add-cors">
<DisplayName>Add CORS</DisplayName>
<FaultRules/>
<Properties/>
<Add>
<Headers>
<Header name="Access-Control-Allow-Origin">{request.header.origin}</Header>
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept, content-type</Header>
<Header name="Access-Control-Max-Age">3628800</Header>
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
</Headers>
</Add>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
#==================================
Chrome
https://user:password@URL
#==================================
CORS:
Access-Control-Allow-Credentials →true
Access-Control-Allow-Origin →https://content.dev-tmp.com
Connection →keep-alive
Content-Length →162
Content-Type →application/json; charset=UTF-8
Date →Wed, 06 Jul 2016 14:23:48 GMT
Server →nginx/1.10.1
Vary →Origin
Via →kong/0.8.1-Kong-Proxy-Latency →0
X-Kong-Upstream-Latency →125
#==================================
curl
curl -v 'https://google.com'
curl -L -X GET --header "Content-Type: application/json" "http://localhost:8000/api/v1/user/" | python -m json.tool | pygmentize -l json
curl -L -X GET --header "Content-Type: application/json" "http://localhost:8000/api/v1/user/" -i
curl --request PATCH/POST/PUT --header 'authorization: Bearer ACCESS_TOKEN' \
curl -X PATCH/PATH/POST/PUT -H 'authorization: Bearer ACCESS_TOKEN' \
-H "Content-Type: application/json" \
-d \
'{"payload":{}
}' \
"https://SOME_URL" \
| python -m json.tool | pygmentize -l json | tee users
export USER=user1
export PASS=secret
data='
{
"query":"MATCH (n) DETACH DELETE n;"
}'
curl -u "$USER:$PASS" -b -j -k -H "Content-Type: application/json" -d "$data" $HOST:$PORT/neo4j/db/data/cypher
#===================================
Django:
django-admin startproject apiexample
python manage.py migrate
python manage.py runserver 0.0.0.0:3010
python manage.py syncdb --all && python manage.py migrate --fake
python manage.py syncdb && python manage.py migrate
mkvirtualenv djangovenv
pip install -r requirements.txt
sudo apt-get install sqlite
django-admin startproject sample-auth
cd sample_auth/sample_auth/
vim settings.py
vim urls.py
cd ..
python manage.py makemigrations app_name --name "some_change"
python manaeg.py sql_migrate
python manage.py migrate app_name
python manage.py show.migrations
python manage.py shell
1) from mny App.model import my_model
2) my_model.objects.all()
3) a = my_model.objects.all()[333]
4) a.email
python manage.py runserver
python manage.py createsuperuser
cd ..
python setup.py install
python setup.py test
#==================================
Docker:
sudo usermod -aG docker $(whoami)
docker ps
docker build -t flask-sample-one:latest .
docker ps -a
docker run flask-sample-one
docker exec -ti [container id] bash
docker login
docker image
docker tag db09fc61f62f lvc0107/flask-sample-one:firsttry
docker push <user-name>/<image-name>
docker push lvc0107/flask-sample-one
Create new container from existing one
docker images -> Get image_repository/image_tag
docker ps -a -> Get docker_id/docker_name
docker docker run -it --entrypoint /bin/bash image_repository -s
Make changes
docker commit --message 'xxx' docker_name/is new_image_respository:image_tag
docker stop docker_name
docker rm docker_name
docker rmi image_repository:image_tag
docker docker run --name new_container_name -d -p 8787:8787 new_image_respository:image_tag
OPTIONAL
docker push
#===================================
git:
git config --global user.name "Migue"
git config --global user.email miguelmnr@gmail.com
git config --global alias.tree 'log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%a
d%Cblue%d %Creset %s %C(bold)(%an)%Creset"'
git config --global alias.tree 'log --graph --full-history --all --color --date=short'
git tree
git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add mergetool.kdiff3.path "/usr/bin/kdiff3"
git mergetool -t kdiff3
git clean -i
git show <commit_id>
git log
git diff
git mv file1 file2
git checkout file
git checkout branch
git checkout -b <new_branch_name>
git branch
git branch -a
If I have a branch feaure cloned in another working firectory
git branch -d feature/teamcity_integration
change the name of local repository:
git branch -m "feature/new_name"
git merge --abort
git fetch origin
git stash save "Stash descriptiion"
git stash apply @{NUM} // check stash description
git stash clear #remove all in stash
git merge branch_2 (step in branch1)
git merge --no-ff branch_2 (step in branch1)
git mergetool -t kdiff3
TODO study
git revert
git cherry-pick
git rebase:
git checkout branch
git rebase master
git mergetool -t kidff3 #if conflict
git add <file>
git rebase --continue
git checkout master
git merge branch
git rm <file>
git rebase --abort
git reset 123455666: this commit is the upper after reseting : The reseted commits remains as local changes
git reset --hard 123454545 : WARNING: dengeraus operation. All reseted commits are erased
git push -f : WARNING: dengeraus operation. All reseted commits are erased
git push: Check if changes in severals branches are pushed
git push origin remote_branch: specific push
Problems with 2fA
https://help.github.com/articles/https-cloning-errors/#provide-access-token-if-2fa-enabled
git remote -v
Creating Acces Token
https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
changing HTTPS by SSH
git remote set-url origin git@github.com:lvc0107/bash.git
git branch -vv
git branch --unset-upstream
git remote add origin git@github.com:natgeo/profile-service.git
#==================================
git-flow
git flow init -f
production -> master
next release -> develop
Feature branches? [feature/]
o enter all
git flow feature start playbooks
git flow feature start update-integration-test
#Delete local branch
git branch -d feature/E2E-test-implementation
git flow feature publish
Pull the branch in another working directory
git init
git flow feature track teamcity_integration
git flow feature delete teamcity_integration
git flow finish teamcity_integration
#===================================
grep:
grep --color=auto -r "word" .
#==================================
iptables:
#==================================
JAVASCRIPT
POST (Works fine multitenant V32 apigee)
var username = "test420@yopmail.com";
var data = {"username": username, "tenantId": "US"};
$.ajax({
type: "POST",
url: "http://URLr",
data: JSON.stringify(data),
contentType: "application/json",
crossDomain : true,
dataType: "json",
success: function(){alert("11111");},
failure: function() {alert("2222");}
});
TESTING
http://www.webtoolkitonline.com/javascript-tester.html
#==================================
Linux:
uname -a
Linux kali 4.9.0-kali4-amd64 #1 SMP Debian 4.9.30-2kali1 (2017-06-22) x86_64 GNU/Linux
uname -r
4.9.0-kali4-amd64
apt-cache search linux-headers-$(uname -r): Verificar headers instalados
apt-get install linux-headers-4.9.0-kali4-amd64: install linux headers
find -name edge.json .
mount -t vboxsf SHARE vm/SHARE: mount virtualbox share folder
reboot
shutdown now
ifconfig
TODO check virtual interfaces
debian:
dpkg -l | less
dpgk -i package
BUSCAR y DELETE
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
#==================================
mysql
#===================================
mvn
mvn install -Pdev -Dusername=$apigee_user -Dpassword=$apigee_pass -Dapigee.config.options=create
#=================================
network manager
#=================================
Neo4j:
si no muestra kvertices borrar kookies de (porjemplo de localhost)
chorme->setting-> content->stetting-> all cokkies and site data ->filtrar y remove
curl --user 'neo4j:intel123' -H Accept:application/json -H Content-Type:application/json -v http://localhost:7474/db/data/
MATCH (n) DETACH DELETE n
MATCH n-[rel:INITIATED]->r
WHERE n.id=f16dbb74efe0686172e3616f28cb6f47 AND r.id=9a97ad3363def2b8d8603d5174006edd
DELETE rel
MATCH (N:KVertex) RETURN "KVertex",COUNT(N)
MATCH ((kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex),(kv)-[r:INITIATED]->(ic:InvestigationCase),(r:Rule)-[a:APPLYING]->(ra:RuleApplication), (ra)<-[ir:INPUT]-(kv),
, (ra)-[or:OUTPUT]->(kv)
RETURN kvt.attr__name, kv.attr__name, ic.attr__name, r.attr__name, ra.attr__name
MATCH (n:KVertex)-[r:INITIATED]->(c:InvestigationCase) where c.id = "efdb1ddc-04f7-49d1-8f31-52d47574ae1c" return n
query para ver cuantas reglas se ejecutaron correctamente
RULES-RULESAPPLICATION:
MATCH (ra:RuleApplication)<-[ir:INPUT]-(iv: KVertex), (ra)<-[a:APPLYING]-(r:Rule) WHERE ra.attr__state = "completed" RETURN ra,r
17-30
NOMBRES DE KVERTEXTYPES NO USADOS
MATCH (kv: KVertexType)
where not kv<-[:LEFT_HAND]-()
RETURN kv.attr__name
RULESAPPLICATION BLOQUEADOS
MATCH (ra:RuleApplication)<-[ir:INPUT]-(iv: KVertex), (ra)<-[a:APPLYING]-(r:Rule) WHERE ra.attr__state = "blocked" RETURN ra,r
RULESAPPLICATION FAILED
MATCH (ra:RuleApplication) WHERE ra.attr__state = "failed" RETURN ra
0
RULESAPPLICATION COMPLETADOS
MATCH (ra:RuleApplication) WHERE ra.attr__state = "completed" RETURN ra
30
REturn sharedfolder kvertex and its type
$match (kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex) where kvt.attr__name="SharedFolders" return kvt,kv,i
queryDNSRecord
match (kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex) where kvt.attr__name="DnsQueryRecord" return kvt,kv,i
UnseenSystemFiles
match (kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex) where kvt.attr__name="UnseenSystemFiles" return kvt,kv,i
match (kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex),
(kvt:KVertexType)<-[i:INSTANCE_OF]-(kv:KVertex)
(kvt2:KVertexType)<-[i2:INSTANCE_OF]-(kv2:KVertex)
where kvt.attr__name="DnsQueryRecord" and kvt2.attr__name="BadReputationIP", kvt2.attr__name="BadReputationIP"
return kvt, kv, i, kvt2, kv2, i2
MATCH (rav:RuleApplication)<-[inr:INPUT]-(inv: KVertex), (rav)<-[apr:APPLYING]-(ruv: Rule),
(ruv)-[xhr:LEFT_HAND|:RIGHT_HAND]->(xhv:KVertexType)
OPTIONAL MATCH (rav)-[rer:RESULT]->(rev: KVertex)-[ior2:INSTANCE_OF]->(xhv)
WHERE ra.attr__state = "completed"
RETURN rav, inr, inv, apr, ruv, rer, rev, ior2
MATCH (ra:RuleApplication),(r:Rule)-[lh:LEFT_HAND]->(lhv: KVertexType)
OPTIONAL MATCH (r)-[rh:RIGHT_HAND]->(rhv: KVertexType)
RETURN r, lh, lhv, rh, rhv
MATCH (ra:RuleApplication)-[ir:RESULT]->(iv: KVertex), (ra)<-[a:APPLYING]-(r:Rule), WHERE ra.attr__state = "completed" RETURN ra,r
MATCH (r:Rule {id:"ITTEST_3790950"})-[lh: LEFT_HAND]->(lhv: KVertexType)
OPTIONAL MATCH (hub: HubKedgesType)-[hrh: HUB_RIGHT_HAND]->(rhv: KVertexType)
OPTIONAL MATCH (hub: HubKedgesType)-[hke: HUB_KEDGE_TYPE]->(ket: KedgeType)
OPTIONAL MATCH (nov: Note)-[anr:ANNOTATED]->(r)
RETURN r, lh, lhv, hub, hrh, rhv, hke, ket, nov, anr
data='
{
"query":"MATCH (n) DETACH DELETE n;"
}
'
curl -b -j -H "Content-Type: application/json" -d "$data" $HOST:$PORT/neo4j/db/data/cypher
o
rm -rf /var/lib/neo4j/data/databases/
#=================================
Ngnix:
#==================================
npm
Install binaries from:
https://nodejs.org/en/download/current/
#==================================
openssl
#==================================
Postgres:
postgres createuser -P <db_user>;
sudo -u postgres createuser -P <db_user>;
sudo -u postgres createdb <db_name> -O <db_user>;
sudo -u postgres dropdb <db_nbame>
service postgresql status/start/restart/stop
psql --version
AUTHENTICATION in psql
sudo -u postgres psql
could not change directory to "/home/luis.vargasb": Permission denied
Password:
psql: FATAL: password authentication failed for user "postgres"
Fix:
sudo vim /etc/postgresql/9.5/main/pg_hba.conf
Add the first line:
local all postgres peer
or
local all postgres trust
service postgresql restart
Check:
https://stackoverflow.com/questions/7695962/postgresql-password-authentication-failed-for-user-postgres
PSQL interpreter
sudo -u postgres psql
\? list all the commands.
\l list databases.
\conninfo display information about current connection.
\c [DBNAME] connect to new database, e.g., \c template1.
\dt list tables.
\q quit psql.
dropdb db
psql -U db_user -c "drop database db"
psql -U "db_user" -c "drop database db"
psql -c "drop database db"
vim /etc/postgresql/9.6/main/pg_hba.conf
psql -d db -U db_user -W
psql -d db -U db -W
su - postgres
sudo -u postgres createuser -P db
#==================================
Python
wget get_pip.py: TODO COMPLETE
pip --version
pip install virtualenv
pip install virtualenvwrapper
pip install ipython
pip install pygments
pip install ipdb
import ipdb ; ipdb.set_trace()
#Add this lines to .bashrc
# Virtualenwrapper
export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh
pip list
pip freeze
pip install -r path/to/requirments.txt
pip freeze | xargs pip uninstall -y
pysftp:
sudo apt-get install libssl-dev
json.dumps(kv,indent=4, sort_keys=True))
os.environt[] =
subprocess.check_call
parcial = functools.partial(api_utils.put_entity(context, api_path="case", entity_id=case_id))
map(lambda x: api_utils.save_entity_in_context(context, case_identifier, case_request['links'] + x), parcial(case_request['links'] + x)), [clue for clue in clues])
python
fatal error: Python.h: No such file or directory (Using python3 in virtualenv)
Fix https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory
Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide.
For apt (Ubuntu, Debian...):
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
For yum (CentOS, RHEL...):
sudo yum install python-devel
For dnf (Fedora...):
sudo dnf install python2-devel # for python2.x installs
sudo dnf install python3-devel # for python3.x installs
#==================================
Rabbit:
sudo apt-get install rabbitmq-server
sudo rabbitmqctl add_user members members
sudo service rabbitmqctl status
service rabbitmq-server start
service rabbitmq-server status
sudo rabbitmqctl add_user members members
sudo rabbitmqctl add_vhost /members
sudo rabbitmqctl set_permissions -p /members members "." "." ".*"
#==================================
Redsock:
REDSOCK
Set proxy variables temporarily
echo 'Acquire::http::Proxy "http://proxy-.com:911";' >> /etc/apt/apt.conf
export HTTP_PROXY=http://proxy-com:911
export HTTPS_PROXY=http://proxy.com:912
export FTP_PROXY=http://proxy-u.com:911
export SOCKS_PROXY=http://proxy.com:1080
export NO_PROXY=bla bla
Update and install redsocks
apt-get update && apt-get install redsocks
Setup transparent proxy (you may need to make file executable with chmod +x enable_socks)
cd <METAMORPH_RELEASE>/redsocks
./enable_socks.sh stop
./enable_socks.sh start
ACA YA SE Puede probar
Persist changes
apt-get install iptables-persistent
Copy redsocks.conf to /etc
cp <METAMORPH_RELEASE>/redsocks/redsocks.conf /etc/redsocks.conf
#==================================
SBT
Run project
sbt -Dhttp.nonProxyHosts=localhost run
Run Cassandra (Ver CASSANDRA secction)
sbt -Dhttp.nonProxyHosts=localhost run -DCASSANDRA_KS=cassandra
Build project
sbt stage universal:packageBin
UT
sbt clean compile test
coverage
sbt clean coverage test coverageReport
IT
sbt -Dhttp.nonProxyHosts=localhost clean it:test
#==================================
Slurm:
#==================================
ssh
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
clip < ~/.ssh/id_rsa.pub
ssh -T git@github.com
On the server side
xclip -sel clip < ~/.ssh/id_rsa.pub
touch ~/.ssh/authorized_keys
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
ssh -i private_key.pem ubuntu@ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com
If there is a docker image running into the ec2 instance
ssh -i private_key.pem core@11.0.11.77
docker ps to show images running in component
Get inside a docker machine
docker exec -ti f56f78eecc07 bash
Analisis dentro del componente:
journalctl grep kube-scheduler
journalctl -u schduler
sudo service supervisor stop
sudo services supervisor start
CREATE CERTIFICATE
openssl req -x509 -newkey rsa:2048 -keyout 10.218.86.84.pem -out cert.pem -days XXX
#==================================
sublime:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
install anaconda,git agila
{
"auto_indent": true,
"draw_white_space": "all",
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
79
],
"smart_indent": true,
"tab_size": 4,
"theme": "Agila.sublime-theme",
"trim_automatic_white_space": true,
"use_tab_stops": true,
"vintage_start_in_command_mode": true,
"word_wrap": true,
"wrap_width": 80,
"save_on_focus_lost" :true
}
#=================================
tmux
ctrl+b up/down: Move between panels
ctrl+b+s: Switch between session
ctrl+b+\": new horizontal panel
ctrl+b+%: new vertical panel
ctrl+b+d: detach
ctrl+b+\[: search
ctrl+b+\$: rename session
ctrl+b+\:: new session
tmux ls: list sessions
tmux a -t <sesionname>: Attach a session by name
tmux new -s <sessionname>: new session
tmux rename-session -t <number_session> <new_name_session>
#===================================
#===================================
utils:
sudo apt-get update
sudo apt-get install tree
sudo apt-get install kdiff3
sudo apt-get install lstopo
sudo apt-get install meld
sudo apt-get install htop
sudo apt-get install tmux
sudo apt-get install postgresql
sudo apt-get install ipython
sudo apt-get install xclip
sudo apt-get install virtualenvwrapper
#==================================
vim
:vsp new_file
:vsp existing file
:sp
/word
:ctrl+w -> <- up /down
:set nu
:set nu!
:u
:w
:qw!
:ctrl+r
1234G
yy
dd
:v
:x
set tab (COMPLETE)
:%s/foo/bar/g
#===================================
VirtualBox:
https://unix.stackexchange.com/questions/405862/headers-for-4-12-0-kali1-amd64-or-location-of-kali-4-13-installer
apt-cache search linux-image
apt-cache search linux-headers
Ejemplo para version 4.14
apt-get install linux-image-4.14.0-kali3-amd64
apt-cache search linux-headers
apt-get install linux-headers-4.14.0-kali3-amd64
reboot
#===================================
Virtualenv:
virtualenv -p /usr/bin/python3.6 venv │
VirtualenvWrapper:
mkvirtualenv venv_name
workon
workon venv_name
deactivate
#==================================
vpn
apt-get install network-manager-{openvpn-gnome,pptp{,-gnome},strongswan,vpnc{,-gnome}}
openvpn --version
vim ~/.cisco/csd-wrapper.sh
openconnect vpn.ngeo.com --csd-wrapper=/root/.cisco/csd-wrapper.sh
comparar contra yopmail
https://10minutemail.com/10MinuteMail/index.html?dswid=7296