appsec.fyi

A somewhat curated list of links to various topics in application security.

Python

LinkExcerpt
The Best VS Code Extensions for Python Developers for 2021We listed the best VS extensions for JS developers. Now, it’s time we do so for the Python community. Same as before: I’m a PyCharm user, I love PyCharm, and I won’t probably be changing editors anytime soon.
Turn Photos into Cartoons Using PythonAs you might know, sketching or creating a cartoon doesn’t always need to be done manually. Nowadays, many apps can turn your photos into cartoons. But what if I tell you, that you can create your own effect with few lines of code?
21 Python Mini Projects With CodeI have been using python for the last 1 and a half year, and the things that I most like about python is its one-liners and packages. One thing that I realize that the best way to learn a programming language is to build projects in it. In this blog, we will see 21 python projects with code.
Create Your Own Cryptocurrency/Blockchain in Python 3.9.1Before you build your own cryptocurrency or blockchain, you’ll need to understand Python and Blockchain’s fundamentals. For a good explanation of Blockchain, I recommend you to visit Investopedia.com — What is Blockchain?
NumPy Illustrated: The Visual Guide to NumPyNumPy is a fundamental library that most of the widely used Python data processing libraries are built upon (pandas, OpenCV), inspired by (PyTorch), or can efficiently share data with (TensorFlow, Keras, etc). Understanding how NumPy works gives a boost to your skills in those libraries as well.
Welcome to Pyramid, a Python Web FrameworkPyramid makes it easy to write web applications. You can start small with this "hello world" minimal request/response web app. This may take you far, especially while learning. As your application grows, Pyramid offers many features that make writing complex software take less effort.
10 Surprisingly Useful Base Python FunctionsThose that work in Python often consider that maybe Python isn’t the star of the show here — but instead its brilliant ecosystem. Often whenever we are working with Python applications, we are working with a lot of dependencies.
5 Python Tricks You Should Start Using in 2021Start the New Year with one of the best New Year’s resolutions: Learn more Python. You can start with this article in which I present 5 Python tricks that will make your life easier.
Three Functions to Know in PythonThere are three functions in python that provide vast practicality and usefulness when programming. These three functions, which provide a functional programming style within the object-oriented python language, are the map(), filter(), and reduce() functions.
Understand Blockchains by Building Your Own in PythonBefore getting into building the blockchain, you need to understand the basics of blockchain. A blockchain is a system that can be used to record data.
Accessing the Dark Web with PythonHello, Reader! In this article, you will learn how to install Tor and configure it in a way that will allow us to make requests with Python to the dark web via Tor’s SOCKS proxy (oooh).
Pocket-APIThis package provides a wrapper class around GetPocket V3 APIs. First, you have to Create your consumer key from getpocket's developer console. To get the access token, you have to authorize the app on your own account.
Python One-Liner →List ComprehensionIf you are using Python language, you should seriously look in to ways for writing efficient code by frequently using List Comprehension instead of for loops wherever applicable.
Everything Is an Object in PythonYou’ve probably heard the saying that everything is an object in Python — one of the most popular object-oriented languages.
5 Python Tricks You Should KnowPython has such an amazing support network it can almost seem like there is too much to take in all at once. This is normal and should be recognised. It can be confusing for those starting out.
How to Write Pythonic LoopsOne of the easiest ways to spot a developer who has a background in C-style languages and only recently picked up Python is to look at how they loop through a list.
Introduction to Python SQL LibrariesAll software applications interact with data, most commonly through a database management system (DBMS). Some programming languages come with modules that you can use to interact with a DBMS, while others require the use of third-party packages.
How to Create a Reverse Shell in PythonThere are many ways to gain control over a compromised system, a common way is to gain interactive shell access, which enables you to try to gain full control of the operating system. However, most basic firewalls blocks direct remote connections.
3 Python list comprehension tricks you might not know yetIf you’ve used Python you’re probably familiar with the list comprehension syntax. Compare that to appending items to an empty list.
Python Descriptors: An IntroductionDescriptors are a specific Python feature that power a lot of the magic hidden under the language’s hood. If you’ve ever thought that Python descriptors are an advanced topic with few practical applications, then this tutorial is the perfect tool to help you understand this powerful feature.
A Python prompt into a running process: debugging with ManholeSometimes your Python process will behave strangely, run slowly, or give you the wrong answers. And while hopefully you have logging, the logging isn’t always enough. So how do you debug this process?
Python Flask Basics Part 1 - Static Home Page#python #flask #webdevelopment #coding #okaydexterPython Flask Basics Part 1 - Static Home Page In this series of videos i'll be showing you how can you start web development in python using flask library. In this video i'll get you through the basics of flask from installation to making a static ho
Remote Procedural Call via XML-RPC in 5 minutesOver the next 5 minutes, we'll bring you up to speed with how to implement XML-Remote Procedural Calls (XML-RPC) in Python 3 with the use of the built-in modules xmlrpc.server and xmlrpc.client.Make sure you don't stop watching until you've considered the security implications as well.Contents:0:00
Top 15 Python Web Development Frameworks to Use in 2019Python is now a mainstream programming language thanks to emerging technologies using Python heavily. Python web development requires the support of a framework to be quick, precise, and cost-effective. Let’s learn which top 15 Python frameworks are trendy in 2019.
Top 10 Best Python IDEs Used By Python Developers in 2019There are many online python IDE that supports easy-to-use, debug mode, code refactoring, graphical debugging, code analysis and many more features. Some of those are free python ide, python ide in mac, python ide on windows. IDE is known as Integrated Development Environment.
PGJones.dev
Vim Config Update: 2019 EditionI like to update my Vim configuration every 2-5 years just to make sure I am working with the latest and greatest version of Vim and that I’m doing things efficiently. Check out my full Vim Tutorial The last few upgrades I’ve been focused on one thing: simplicity.
What’s in your Pocket? Visualizing your Reading List with PythonBLOG Build the future of communications. Start building for free Build the future of communications. Start today with Twilio's APIs and services. Start Building for Free Twitter Facebook New! Tutorials Sample applications that cover common use cases in a variety of languages.
Has the Python GIL been slain?In early 2003, Intel launched the new Pentium 4 “HT” processor. This processor was clocked at 3 GHz and had “Hyper-Threading” Technology.
How to Extract Words from PDFs with PythonAs I mentioned in my previous article: How to Connect to Google Sheets with Python, I’ve been working with a client to help them parse through hundreds of PDF files to extract keywords in order to make them searchable.
The easy way to work with CSV, JSON, and XML in PythonPython’s superior flexibility and ease of use are what make it one of the most popular programming language, especially for Data Scientists. A big part of that is how simple it is to work with large…
The definitive guide to setup my Python workspaceHave you ever focused on a task, but then needed to execute some quick command to move on and it didn’t work because your workspace was a mess? When this happens you lose your flow and must first solve your tools’ problem, to then work on your original problem.
SQLAlchemyWe often encounter data as Relational Databases. To work with them we generally would need to write raw SQL queries, pass them to the database engine and parse the returned results as a normal array of records. SQLAlchemy provides a nice “Pythonic” way of interacting with databases.
Building Minimal Docker Containers for Python ApplicationsThis post was last updated September 19th, 2019. A best practice when creating Docker containers is keeping the image size to a minimum. The fewer bytes you have to shunt over the network or store on disk, the better.
The Why, When, and How of Using Python Multi-threading and Multi-ProcessingA wise and powerful wizard lives in a small village in the middle of nowhere. Let’s call him Dumbledalf. Not only is he wise and powerful, but he’s also happy to help anyone who asks and this means that people come from far and wide to ask the wizard for aid.
JSONJavaScript Object Notation (JSON) is a lightweight data-interchange format based on the syntax of JavaScript objects. It is a text-based, human-readable, language-independent format for representing structured object data for easy transmission or saving.
Create a Twitter Bot in Python Using TweepyWith about 15% of Twitter being composed of bots, I wanted to try my hand at it. I googled how to create a Twitter bot and was brought to a cleanly laid out web app. It allowed you to create a bot that would like, follow, or retweet a tweet based on a keyword.
Python List Comprehensions in 5-minutesWhy would you want to do a Python list comprehension? To save lines of code.
Build Simple Restful Api With Python and Flask Part 2In this article I will show you how to build simple restful api with flask and SQLite that have capabilities to create, read, update, and delete data from database. Similar with my article on part 1(https://medium.
How I used Python to analyze Game of ThronesI wanted to learn Python for a long time, but I could never find a reason. When my company had a bunch of daily reports that needed to be generated, I realized I had an opportunity to explore Python to cut out all the repetition.
Write Better Python FunctionsIn Python, like most modern programming languages, the function is a primary method of abstraction and encapsulation. You’ve probably written hundreds of functions in your time as a developer. But not all functions are created equal.
An Introduction to Clustering Algorithms in PythonIn data science, we often think about how to use data to make predictions on new data points. This is called “supervised learning.” Sometimes, however, rather than ‘making predictions’, we instead want to categorize data into buckets. This is termed “unsupervised learning.”
Python Virtual Environments made easyI was starting a project where I had to quickly check if a package, Flask, worked with the Python installed on my machine. As I ran the command to install Flask, it alerted me that the package was already installed as I had Anaconda on my machine.
Understanding self in PythonOnce you start using Python, there is no escaping from this word “self”. It is seen in method definitions and in variable initialization. But getting the idea behind it seems somewhat troublesome.
Understanding the asterisk(*) of PythonPython has plentiful types of operations compared to other languages. Especially, the Asterisk(*) that is one of the most used operators in Python allows us to enable various operations more than just multiplying the two numbers.
How to Web Scrape with Python in 4 MinutesWeb scraping is a technique to automatically access and extract large amounts of information from a website, which can save a huge amount of time and effort. In this article, we will go through an easy example of how to automate downloading hundreds of files from the New York MTA.
Python List Comprehensions VS Generator ExpressionsThe article is written by Mariia Yakimova (MARIIA YAKIMOVA) — an backend engineer at Django Stars. This python list comprehensions is originally posted on Django Stars. Specially shared with freeCodeCamp community.
Why you should use pyenv + Pipenv for your Python projectsThis is an opinionated way of developing with Python locally. You’ve probably discovered that it’s a pain in the ass to manage different projects with dependencies targeting different Python versions on your local machine.
Writing your own programming language and compiler with PythonAfter studying compilers and programming languages, I felt like internet tutorials and guides are way too complex for beginners or are missing some important parts about these topics.
What’s in a (Python’s) __name__?You’ve most likely seen the __name__ variable when you’ve gone through Python code. Below you see an example code snippet of how it may look: In this article, I want to show you how you can make use of this variable to create modules in Python.
Another Twitter sentiment analysis with Python — Part 1It has been a while since my last post. During my absence in Medium, a lot happened in my life. I finally gathered my courage to quit my job, and joined Data Science Immersive course in General Assembly London. It was a big decision in my life, but I don’t regret it.
A tour of the top 5 sorting algorithms with Python codeSorting is a skill that every software engineer and developer needs some knowledge of. Not only to pass coding interviews but as a general understanding of programming itself.
Dismissing Python Garbage Collection at InstagramBy dismissing the Python garbage collection (GC) mechanism, which reclaims memory by collecting and freeing unused data, Instagram can run 10% more efficiently. Yes, you heard it right! By disabling GC, we can reduce the memory footprint and improve the CPU LLC cache hit ratio.
HowGenerators have been an important part of Python ever since they were introduced with PEP 255. Generator functions allow you to declare a function that behaves like an iterator.
5 Advanced Features of Python and How to Use ThemPython is a beautiful language. Simple to use yet powerfully expressive. But are you using everything that it has to offer? The advanced features of any programming language are usually discovered through extensive experience.
Build Simple Restful Api With Python and Flask Part 1I’m going to divide this series into 3 or 4 articles. At the end of the series you would understand how easy to build restful API with flask. In this article we’ll setting our environment and create endpoint that will show “Hello World”. Flask is microframework for python.
Asynchronous PythonAsynchronous programming in python has become more and more popular lately. There are many different libraries in python for doing asynchronous programming. One of these libraries is asyncio, which is a python standard library added in Python 3.4.
Building Beautiful Command Line Interfaces with PythonBefore we dive in building the command line application, lets take a quick peek at Command Line. Command Line programs has been with us since the creation of computer programs and are built on commands. A command line program is a program that operates from the command line or from a shell.
36 Amazing Python Open Source Projects (v.2019)For the past year, we’ve compared nearly 5,000 open source Python projects and selected the top 36. The average number of Github ⭐️ is 1,667.
10 common security gotchas in Python and how to avoid themWriting secure code is hard. When you learn a language, a module or a framework, you learn how it supposed to be used. When thinking about security, you need to think about how it can be misused.
10 Python File System Methods You Should KnowYou can write Python programs to interact with the file system to do cool stuff. How to do so isn’t always super clear. This article is a guide for current and aspiring developers and data scientists.
Lambda, Map, and Filter in PythonToday’s piece covers using lambda, map, and filter functions in Python. We’ll be covering the basic syntax of each and walking through some examples to familiarize yourself with using them. Let’s get started! A lambda operator can have any number of arguments but can have only one expression.
Intro to Threads and Processes in PythonCompeting in Kaggle’s Understanding the Amazon from Space competition, I started timing various parts of my code to see if I could speed things up. Speed is critical in Kaggle. Ranking well often requires trying hundreds of architectural and hyper-parameter combinations.
Understanding the underscore( _ ) of PythonI’m not a native speaker. Sorry for my english. Please understand. The underscore (_) is special in Python.
I Wrote a Script to WhatsApp My Parents Every Morning in Just 20 Lines of Python CodeIn our busy work lives, we often forget to WhatsApp our loved ones. Looking at how regular my parents are in messaging me with inspirational quotes and health tips first thing in the morning, it was time to reciprocate.
How I used Python to find interesting people to follow on MediumMedium has a large amount of content, a large number of users, and an almost overwhelming number of posts. When you try to find interesting users to interact with, you’re flooded with visual noise. The process was tedious.
30 Amazing Python Projects for the Past Year (v.2018)For the past year, we’ve compared nearly 15,000 open source Python projects to pick Top 30 (0.2% chance). This is an extremely competitive list and it carefully picks the best open source Python libraries, tools and programs published between January and December 2017.
A million requests per second with PythonIs it possible to hit a million requests per second with Python? Probably not until recently. A lot of companies are migrating away from Python and to other programming languages so that they can boost their operation performance and save on server prices, but there’s no need really.
Building a Simple Chatbot from Scratch in Python (using NLTK)Gartner estimates that by 2020, chatbots will be handling 85 percent of customer-service interactions; they are already handling about 30 percent of transactions now. I am sure you’ve heard about Duolingo: a popular language-learning app, which gamifies practicing a new language.
How to scrape websites with Python and BeautifulSoupThere is more information on the Internet than any human can absorb in a lifetime. What you need is not access to that information, but a scalable way to collect, organize, and analyze it. You need web scraping.
An A-Z of useful Python tricksPython is one of the world’s most popular, in-demand programming languages. This is for many reasons: I use Python daily as an integral part of my job as a data scientist. Along the way, I’ve picked up a few useful tricks and tips.
What exactly can you do with Python? Here are Python’s 3 main applications.Well that’s a tricky question to answer, because there are so many applications for Python. Let’s talk about each of them in turn.
Why Is There an F in Front of This String?How do I add my variable into a string in Python? If I have someone’s name, how do I print this back out, with additional information, like a hello message? Noun.
Pyshark - Python Wrapper For Tshark, Allowing Python Packet Parsing Using Wireshark DissectorsPython wrapper for tshark, allowing python packet parsing using wireshark dissectors. Extended documentation: http://kiminewt.github.io/pyshark Python2 deprecation - This package no longer supports Python2. If you wish to still use it in Python2, you can: Use version 0.3.
Python 3's f-Strings: An Improved String Formatting Syntax (Guide)Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Python 3's f-Strings: An Improved String Formatting Syntax As of Python 3.6, f-strings are a great new way to format strings.
The Ultimate List of Python YouTube ChannelsWe couldn’t find a good, up-to-date list of Python developer or Python programming YouTube channels online. Learning Python on YouTube is a viable option these days, and we’re excited about what this new medium can do for programming education.
Top 10 Visual Studio Code extensions for Python developmentI developed my last two projects using VSCode. Before using VSCode I was a heavy Vim user, but I needed something more. Microsoft’s VSCode is a robust, open-source, a multi-platform editor that has quickly become my code editor of choice.
Building a Simple Web App With Bottle, SQLAlchemy, and the Twitter APILast October we challenged our PyBites’ audience to make a web app to better navigate the Daily Python Tip feed. In this article, I’ll share what I built and learned along the way. If you want to follow along, reading the code in detail (and possibly contribute), I suggest you fork the repo.
The Flask Mega-Tutorial Part I: Hello, World!Welcome! You are about to start on a journey to learn how to create web applications with Python and the Flask framework. The video above will give you an overview of the contents of this tutorial. In this first chapter, you are going to learn how to set up a Flask project.
Twitter Sentiment Analysis – Python, Docker, Elasticsearch, KibanaIn this example, we’ll connect to the Twitter Streaming API, gather tweets (based on a keyword), calculate the sentiment of each tweet, and build a real-time dashboard using the Elasticsearch DB and Kibana to visualize the results.
What Can I Do With Python?You’ve done it: you’ve finished a course or finally made it to the end of a book that teaches you the basics of programming with Python. You’ve mastered lists, dictionaries, classes, and maybe even some object oriented concepts. So… what next?
Why is Python so slow?Python is booming in popularity. It is used in DevOps, Data Science, Web Development and Security. It does not, however, win any medals for speed.
Modifying the Python language in 6 minutesThis week I raised my first pull-request to the CPython core project, which was declined :-( but as to not completely waste my time I’m writing my findings on how CPython works and show you how easy it is to modify the Python syntax.
Why is Python so slow?Python is booming in popularity. It is used in DevOps, Data Science, Web Development and Security. It does not, however, win any medals for speed.
SQLAlchemy ORM Tutorial for Python DevelopersTL;DR: In this article, we will learn how to use SQLAlchemy as the ORM (Object Relational Database) library to communicate with relational database engines.
Introductory Tutorial of Python's SQLAlchemyA common task when programming any web service is the construction of a solid database backend. In the past, programmers would write raw SQL statements, pass them to the database engine and parse the returned results as a normal array of records.
Fluent Python: The Power of Special MethodsYou’ve used Python for years. Do you really know it? Be brave and skin that Python. In this cut, Luciano Ramalho probes deep into special methods and the Data Model. Become fluent with idiomatic Python.
Metaprogramming — Python 3 Patterns, Recipes and IdiomsObjects are created by other objects: special objects called “classes” that we can set up to spit out objects that are configured to our liking. To modify a class, you perform operations on it like any other object. You can add and subtract fields and methods, for example.
What are metaclasses in Python?What are metaclasses and what do we use them for? A metaclass is the class of a class. Like a class defines how an instance of the class behaves, a metaclass defines how a class behaves. A class is an instance of a metaclass.
PEP 20 -- The Zen of PythonLong time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.
Idiomatic Python — Intermediate and Advanced Software Carpentry 1.0 documentationI’m sure you’re all familiar with tuples, lists, and dictionaries, right? Let’s do a quick tour nonetheless. That’s about all I have to say about tuples.
Python Data Science TutorialsThis repo contains a curated list of Python tutorials for Data Science, NLP and Machine Learning. Curated list of R tutorials for Data Science, NLP and Machine Learning.
Intro to Flask: Adding a Contact PageIn the previous article in this mini-series, we leveraged Flask to build a simple website that contains "Home" and "About" pages using a generalized workflow that we can apply to other Flask-based web apps.
Primer on Jinja TemplatingFlask comes packaged with the powerful Jinja templating language. For those who have not been exposed to a templating language before, such languages essentially contain variables as well as some programming logic, which when evaluated (or rendered into HTML) are replaced with actual values.
Preface¶This book is a collection of the best practices for using Flask. There are a lot of pieces to the average Flask application. You’ll often need to interact with a database and authenticate users, for example.
python/scapy DNS sniffer and parser#!/usr/bin/env python from scapy.all import * from datetime import datetime import time import datetime import sys ############# MODIFY THIS PART IF NECESSARY ############### interface = 'eth0' filter_bpf = 'udp and port 53' # ------ SELECT/FILTER MSGS def select_DNS(pkt): pkt_time = pkt.
The Python Indie BundleThree Best-Selling Books for the Price of One! Your purchase includes the book in PDF, Kindle (.mobi), and ePub formats.