Skip to content

Instantly share code, notes, and snippets.

View aduquet's full-sized avatar
👩‍💻
Focusing

Aleja Duque-Torres aduquet

👩‍💻
Focusing
View GitHub Profile
@aduquet
aduquet / Fix python unsupported locale error in Debian based distro
Created August 23, 2018 00:14
locale.Error: unsupported locale setting
I was installing some python libraries that I needed, and this message came up:
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python3.5/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
@aduquet
aduquet / LSOF
Created August 23, 2018 01:16
LSOF
sh-3.2# lsof -i4
In the COMMAND column is the program that is creating the session (connection). The TYPE column shows whether it is an IPv4 or IPv6 connection. NODE column shows the used transport layer protocol (TCP/UDP), while the last column shows the SRC-IP:PORT -> DST-IP:PORT information.
I cleaned up the output with some useful linux utilities:
sh-3.2# lsof -nP -i4 | grep -v "localhost\|*\|127.0.0.1" | awk '{printf ("%10s\t%3s\t%s\n", $1, $8, $9)}’
COMMAND NODE NAME
apsd    TCP  10.140.59.187:61720->17.252.252.86:5223
@aduquet
aduquet / How to use scp
Last active November 11, 2018 22:04
scp linux comand
EXAMPLE 1:
To copy from nuc to jump server:
scp nuc@nuc3:~/flowRecorder/univ2_pt4-* ./
to Copy from Jump server to PC
scp -P 2020 aleja@103.196.108.25:univ2* ./
EXAMPLE 2:
@aduquet
aduquet / Fix- python - dpkt invalid tcpdump header error -
Created August 25, 2018 04:52
python - dpkt invalid tcpdump header error -
I was runing a python code with some pcaps file, and this message came up:
Traceback (most recent call last):
File "flowRecorder.py", line 900, in <module>
main()
File "/home/alduk/Dropbox/Aleja_Internship/FlowID/venv/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/alduk/Dropbox/Aleja_Internship/FlowID/venv/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/alduk/Dropbox/Aleja_Internship/FlowID/venv/lib/python3.6/site-packages/click/core.py", line 895, in invoke
@aduquet
aduquet / install pcapy
Created September 4, 2018 04:52
problem installing pcapy libs
I was installing pcapy, but outgoing notifications like this :
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
pcapdumper.cc:11:18: fatal error: pcap.h: No such file or directory
#include
^
@aduquet
aduquet / traffic generators.
Created March 8, 2019 03:11
traffic generators.
traffic generators.
TRex - TRex is an open source, low cost, stateful and stateless traffic generator fuelled by DPDK. It generates L4-7 traffic based on pre-processing and smart replay of real traffic templates . TRex amplifies both client and server side traffic and can scale up to 200Gb/sec with one UCS.
Latest commit: 16 days ago
https://trex-tgn.cisco.com/
D-ITG - (Distributed Internet Traffic Generator) is a platform capable to produce traffic at packet level accurately replicating appropriate stochastic processes for both IDT (Inter Departure Time) and PS (Packet Size) random variables (exponential, uniform, cauchy, normal, pareto, …). D-ITG supports both IPv4 and IPv6 traffic generation and it is capable to generate traffic at network, transport, and application layer.
Download page last updated: 2 July, 2013
http://traffic.comics.unina.it/software/ITG/
@aduquet
aduquet / Problems with "yo code"
Last active September 10, 2021 12:49
Problems with "yo code" -> stderr: "'powershell' is not recognized as an internal or external command,\r\n"
Well, this error may looks silly, but I spent a lot of hours looking for the answer
after excecuting the command "yo code"
I got this error:
c:\Users\blalbalba\npm\node_modules\yo\node_modules\execa\index.js:347
thorw err;
and a lot of more things. The mos important was this error line
stderr: "'powershell' is not recognized as an internal or external command,\r\n" + 'operable program or batch file.\r\n',
@aduquet
aduquet / gist:ce365c8e00bade71d17ddbfe6edc578f
Created February 26, 2022 15:12
Error in firebase with flatter
C:\Users\duquet\Documents\Personal\Empresa\quiz-flutter\quiz_app_v2\quiz\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] C:\Users\duquet\Documents\Personal\Empresa\quiz-flutter\quiz_app_v2\quiz\build\cloud_firestore\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="io.flutter.plugins.firebase.firestore" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
@aduquet
aduquet / FirebaseStore with Flutter
Created March 14, 2022 06:06
Reading data from firebaseStore with flutter... SOLUTION! :)
I spend a lot of time trying to access a specific document from firebase DB with flutter.
This is some links that help me
https://stackoverflow.com/questions/53517382/query-a-single-document-from-firestore-in-flutter-cloud-firestore-plugin
https://stackoverflow.com/questions/67575893/the-method-cant-be-unconditionally-invoked-because-the-receiver-can-be-nu
https://stackoverflow.com/questions/69624553/flutter-error-the-operator-isnt-defined-for-the-class-object
@aduquet
aduquet / Flutter issues
Created March 25, 2022 08:21
type 'Future<dynamic>' is not a subtype of type 'Stream<Object?>?'
I was dealing with
type 'Future<dynamic>' is not a subtype of type 'Stream<Object?>?'
I had no Future types in my app however I did have something like this:
getQuestion(String id, String collectionName) async {
//var collection = FirebaseFirestore.instance.collection(collectionName);
// var querySnapshots = await collection.get();
// for (var snapshot in querySnapshots.docs) {