Tumgik
nsardo · 1 year
Text
Wrangling Proxies with Ruby
I needed a list of free proxies, obviously the more the better. Though I didn’t take this as far as I could have, I automated it quickly enough to get a quick and dirty list. Ruby always makes things better. First, I downloaded a list from https://geonode.com/free-proxy-list in JSON format. Next, I whipped up this quick Ruby script to pull out what I needed: require 'json' file =…
View On WordPress
0 notes
nsardo · 1 year
Text
Use Toastr with Meteor in 2023
1. Install with: meteor npm install --save toastr 2. In your .js/.ts/.coffee file, add: import toastr from '/node_modules/toastr/build/toastr.min.js'; 3. In your .scss file, add: @import "{}/node_modules/toastr/toastr.scss"; 4. Now to make a toast in a method, just add something like: toastr.success("BoomboomShakkalakkah!");
View On WordPress
0 notes
nsardo · 5 years
Text
Starting a Text Adventure in Corona SDK
Starting a Text Adventure in Corona SDK
Tumblr media
I was looking at the “Choose your Adventure” type games on the Play Store, and wondered how it would be to do something like that in Corona.
A couple of strategies that present themselves as obvious, might be: one, using composer where each choice goes to a different scene. That would end up being a lotof Lua files! Another way might be saving the content into a file or files, and reading them in…
View On WordPress
0 notes
nsardo · 6 years
Text
Playing with Golang and CSV Files
Playing with Golang and CSV Files
Golang is not only fun to code, but incredibly easy too. I like to think of the way it handles pointer’s as, “pointer’s Lite“. But, none of that for this post.
I enjoy writing code in different languages. I wanted something quick that would just list the header titles in a CSV file. The meat of my approach was arguably lower level than it needed to be, but damn quick and easy to code none the…
View On WordPress
0 notes
nsardo · 6 years
Text
PHP 7 twist on an old problem: FizzBuzz
PHP 7 twist on an old problem: FizzBuzz
Two of the nice new features of PHP 7 is Type Declarations and Return Type Declarations, both coercive and strict. Obviously having typing is a benefit for both debugging and clearer code.
Considering the “FizzBuzz”  [1]   problem, these new features can work to our advantage both in function inputs, and function outputs. Added to return types is iterable which, as you’ll see, will come in handy.
View On WordPress
0 notes
nsardo · 6 years
Text
Easily Deploy a Meteor Project without mup, mupx, etc.
Easily Deploy a Meteor Project without mup, mupx, etc.
Deploying a basic Meteor project is super simple, and does not require any special deployer like mup or mupx/meteor-up, etc. [1].
The following is a simple recipe to get things started off:
On your deployment server, install the following: a) Node.js + NPM. You might need to mind the versions. Lately, I’m doing a lot with AWS EC2’s, and so depending on the node version in the package manager, I…
View On WordPress
1 note · View note
nsardo · 6 years
Text
Hacking Git: Changing the Originator of a Repo
Hacking Git: Changing the Originator of a Repo
I was in a hurry on one of the servers I manage, and moved along not really thinking about what I was doing. I cloned a repo, and commenced to building it for production. Sadly, I cloned it as https://[email protected] than my app’s credentials (for ssh). When doing a trial run of my cronjob build script (continuous integration via bash…) I got flagged with git requesting my password for the…
View On WordPress
0 notes
nsardo · 7 years
Text
Security Basics with Ruby: Who is trying to hack me part 2
Security Basics with Ruby: Who is trying to hack me part 2
Tumblr media
I left things with a function that would analyze the “auth.log” function, finding Invalid login attempts to our server. The natural next step is to find out where these attempts are coming from. Bear in mind, seldom will an IP be a unique, 1 to 1 correspondence to an actor. Most often, they are behind an ISP, a proxy(or string of proxies), or both. But, we can initially find out where the last…
View On WordPress
0 notes
nsardo · 7 years
Text
Security Basics with Ruby: who is trying to hack me?
Security Basics with Ruby: who is trying to hack me?
The location of log files might generally be found in the /var/logs/ directory. This can be a treasure box of information for a variety of uses. One interesting use is to gain a list of suspects of who might be trying to hack our server. In this post, I’m going to deal specifically with the log file called, “auth.log“. In this file we can see who is trying to sshinto our system.  Here is a…
View On WordPress
0 notes
nsardo · 7 years
Text
Finding duplicate fields in a MongoDB database using Perl
Finding duplicate fields in a MongoDB database using Perl
I had occasion to need to check a MongoDB collection for duplicate fields, and thought a basic script for this might prove instructive for some who may have the same need. The file itself can be viewed and downloaded –here–.  I’ll explain the basics of the script top to bottom, chunk by chunk:
#!/usr/bin/perl use strict; use warnings; use MongoDB; use v5.18; my ($db_name, $coll_name) = (DB_NAME,…
View On WordPress
0 notes
nsardo · 7 years
Text
How to Screen Scrape: The Basics
How to Screen Scrape: The Basics
Tumblr media
Screen Scraping has become a more important activity as information on the web becomes more and more commoditized. I did a post on screen scraping with Ruby, but thought a more basic post showing the mechanics of creating a scrape might be useful to some. I’m going to use one of my favorite imperative scripting languages: Perl, but the techniques will translate to whatever you want to use. I’m…
View On WordPress
0 notes
nsardo · 7 years
Text
Developing an algorithm
Tumblr media
Say we are building a robot.
We just purchased a kit from Robots R Us, and find that there are 3 pegs upon which we are to affix some gears. Pretend that we have no common sense, or intuition about gears, so that all we have available to us is the math we learned in high school (remember thinking, “when am I ever going to need this…”). Our goal is to gear our robot with a 2:1 drive gear to driven…
View On WordPress
0 notes
nsardo · 7 years
Text
A good case for refactoring, for those who might be not feel comfortable with the idea
A good case for refactoring, for those who might be not feel comfortable with the idea
This is just a quick article on basic refactoring, aimed at those who would benefit from an example.
Often when I’m solving a problem, I break it apart into a bunch of little self contained units… often many small functions I can compose or otherwise make use of to solve the problem. There’s a case to be made for having lots of little functions. they can be passed around, or made into an assembly…
View On WordPress
0 notes
nsardo · 7 years
Text
Robomongo connect to AWS EC2 behind ssl redirect/tunnel
Robomongo connect to AWS EC2 behind ssl redirect/tunnel
A client of mine has a few EC2 instances that I manage. One of them I installed an SSL Cert on, and all http traffic is forwarded to https.
The Mongodb instance is bound to 0.0.0.0:27017, but I found no way to get Robomongo to connect. Instead, I set up an SSH port forwarding where my local mac listens on port 5555, and passes though (tunnels) the remote server’s port 27017 traffic as a…
View On WordPress
0 notes
nsardo · 7 years
Text
Fun with Meteor, React, and React-Bootstrap
Fun with Meteor, React, and React-Bootstrap
Sad as it is, for articles heavy in mark-up, WordPress has proven to be a light-weight, so I have to link to my own article on blogger, lol.  I played a bit with React-Bootstrap, in the context of a Meteor + React project.  The article is here:
https://nsardo.blogspot.com/2017/05/fun-with-meteor-react-and-react.html
View On WordPress
0 notes
nsardo · 7 years
Text
Dead Simple React.js with Meteor
Dead Simple React.js with Meteor
RANT ABOUT WORDPRESS PRELUDE: Wordpress REALLY SUCKS at handling pre-formatted code containing HTML, and that is EVEN IF all the proper character escapes are used. Blogger works as expected, and so this post can be viewed there:
https://nsardo.blogspot.com/2017/05/dead-simple-reactjs-with-meteor.html
View On WordPress
0 notes
nsardo · 7 years
Text
React Simplicity
This is just a quick intro to React to show how easy it is on a very basic level. React is often compared to Angular, but the two are very different: Angular is more of a framework, whereas React is more of a library. So, with React, we can make Components, and in so doing, we can intersperse plain Javascript to instill behavior. This article is not showing (or using) best practices, or a…
View On WordPress
0 notes