Facebook Post Deletor

I published the code snippet to delete Facebook posts as a Chrome extension to make it easier for non-technical users to take advantage of it.

You can get the extension from the link below:
https://chrome.google.com/webstore/detail/fb-post-deletor/opbnkoiemagfialjgeablaeahkpkcgbb

The source code for the extension is published on github:
https://github.com/hasankhan/fb-post-deletor

Delete all tweets from Twitter

Just as we found a way to delete all posts from Facebook, we can apply the same technique to Twitter. Follow the steps below to wipe clean all your old tweets on Twitter.

  1. Log in to Twitter using Chrome browser
  2. Go to your timeline
  3. Scroll all the way down to your first tweet in order to load all the tweets in the UI.
  4. Open developer console (F12)
  5. Paste the following javascript snippet in the ‘Console’ tab
function dT(){var e=document.getElementsByClassName("js-actionDelete");e&&e.length>0&&(e[0].click(),setTimeout(function(){var e=document.querySelector("div#delete-tweet-dialog button.delete-action");e&&e.click()},1e3))}var deletor=setInterval(dT,1e4);

It will now delete your old tweets every 10 seconds for as long as the browser window is open. Enjoy!

Delete all posts from Facebook

I have a habit of cleaning up my social media profile every now and then and starting over fresh. However manually deleting posts can be a pain, specially if you’re doing it after a long time.

I could technically use Facebook SDK and write a program to do this for me however it seems that Facebook APIs only allow deleting those posts that are made from the same app that is deleting the posts. However I can go to my activity page on Facebook and delete posts one by one manually.

So I decided I’ll just automate this using javascript snippet. Follow the steps below to wipe clean all your old posts (include pics) on Facebook.

  1. Log in to Facebook using Chrome browser
  2. Go to your activity log
  3. Scroll all the way down to your first post in order to load all the posts in the UI.
  4. Open developer console (F12)
  5. Paste the following javascript snippet in the ‘Console’ tab
function dP(){var e=document.querySelector(".audienceSelectorNoTruncate ~ div.uiPopover a");e&&e.click();var t=document.querySelectorAll("a[ajaxify*=delete]");t.length>0&&t[t.length-1].click(),setTimeout(function(){var e=document.querySelector("div[role=dialog] form[rel=async] button[type=submit]");e&&e.click()},1e3)}var deletor=setInterval(dP,1e4);

It will now delete your old post every 10 seconds for as long as the browser window is open. Enjoy!

Also check out Delete all tweets from Twitter

Squiggle 3.4 Beta released

I’m glad to announce the Squiggle 3.4 release today. You can get it from codeplex release page. This is mainly a maintenance release as the main update in this release is fewer and updated dependencies.

Earlier version of Squiggle had 2 dependencies zeromq and SQL Server CE that caused installation problems for many people. It was also built using an older version of .NET Framework that many people had to download and install. With version 3.4 release of Squiggle, I’ve switched to a 100% managed implementation of zeromq protocol and SQLite as the database for tracking history. It is built using latest .NET Framework 4.5.1.

I’ve also updated the MSI setup to install Squiggle in AppData folder instead of ProgramFiles(x86) so hopefully it should also help in reducing permission related problems in running plugins and sharing files.

My initial testing shows that it works fine on Windows 8.1. You may try it out and report any bugs on our issues page.

sql-cli v0.3.0 Released

I just released the v0.3.0 of sql-cli on npm. It has following new features:

.analyze command: Lists all the missing indexes on a table. Works only on actively used databases.
.read command: Allows you to run a sql script file in the cli
-config argument: Allows you to specify a json config file to read connection information from

Feel free to share feedback or fork and send pull requests on github.

sql-cli v0.1.0 Released

I just released the v0.1.0 of sql-cli on npm. It has following new features:

  • .index command: Lists all the indexes on a table
  • .schema command: Now tells you whether column is indexed or not
  • New output format switch -f: Now you can export your query results as json, xml or csv

I also fixed a few formatting/output related issues and improved the .schema and .tables queries. Feel free to share feedback or fork and send pull requests.

Introducing sql-cli: a Nodejs Command-line Interface for Sql Server

SQL Server used to be a database that was only used by Windows users in the past and so not much effort has been put in to making tools like SQL Server Managed Studio and sqlcmd available for linux and mac users. However with advent of cloud and hosted databases, it doesn’t matter much what OS the database is hosted on; as long as you can connect to the database from variety of platforms. This is true for SQL Azure which is now used by many mac and linux users directly or indirectly (via Azure Mobile Services). However due to lack of good tools to manage the database, users have been forced to use browser based tools or using Windows tools from inside a virtual machine. However this is now going to change.

Today I’m pleased to announce sql-cli: A cross platform command line interface to SQL Server written in nodejs. Without further ado let’s see how you can use it.

Installation

You can install sql-cli simply by running the following command.

npm install -g sql-cli

Alternatively you can clone the git repository

git clone https://github.com/hasankhan/sql-cli.git
cd sql-cli
npm install -g

Get Started

Once installed you get a new ‘mssql’ command in your environment. Running it without arguments will give show you the following:

  Usage: mssql [options]

  Options:

    -h, --help                     output usage information
    -V, --version                  output the version number
    -s, --server [server]          Server to conect to
    -u, --user [user]              User name to use for authentication
    -p, --pass [pass]              Password to use for authentication
    -o, --port [port]              Port to connect to
    -t, --timeout [timeout]        Connection timeout in ms
    -d, --database [database]      Database to connect to
    -v, --tdsVersion [tdsVersion]  Version of tds protocol to use
    -e, --encrypt                  Enable encryption

To connect to a sql server instance invoke mssql as follows

mssql -s localhost -u user -p pass -d dbname

For SQL Azure you have to enable encryption and add server name in username

mssql -s abcdef.database.windows.net -u username@abcdef -p thepassword -d mydatabase -e

Once connected you’re greeted with a prompt as follows:

Connecting to localhost...done

sql-cli version 0.0.6
Enter ".help" for usage hints.
mssql>

To get help you can use the ‘.help’ command like so:

command        description
-------------  ---------------------------
.help          Shows this message
.tables        Lists all the tables
.schema TABLE  Shows the schema of a table
.databases     Lists all the databases
.quit          Exit the cli

Following is a sample session:

mssql> use test
OK
mssql> .tables
TABLE_CATALOG  TABLE_SCHEMA  TABLE_NAME          TABLE_TYPE
-------------  ------------  ------------------  ----------
test           dbo           Customers           BASE TABLE
test           dbo           Orders              BASE TABLE
test           dbo           MyEntityDatas       BASE TABLE
test           dbo           __MigrationHistory  BASE TABLE

mssql> select * from Customers
CustomerId  Name
----------  --------
1           Henrik
2           Scott
3           Benjamin

Feel free to fork the git repo and contribute enhancements https://github.com/hasankhan/sql-cli

Squiggle 3.3 Declared Stable

After 20,000+ downloads, I’m declaring Squiggle 3.3 as stable. The code for Squiggle 3.3 is in 3.3 branch in git. If there is any critical bug fix, it will go in the same branch and will be merged back to master otherwise all bug fixes will now go to 3.4 branch.

For Squiggle 3.4 release I’m going to be once again changing the communication layer. I want to try .NET port of ZeroMQ called NetMQ. This means it will not be backwards compatible with older version. However this will help in reducing the amount of software people have to install to get Squiggle to work i.e. VC++ runtime. Other changes that I’m planning for v3.4 are as under:

  • Upgrade to .NET 4.5
  • Use async-await in code and get rid of dispatcher calls to switch threads
  • Switch to SQLite as local database to reduce installation payload and dependencies
  • Reduce memory footprint

I do not plan on doing any new features for 3.4 release as of now.

Squiggle 3.3 Beta Released

Version 3.3 of Squiggle has been released on CodePlex as Beta release.

New features include:

  • Allow using environment variables in configuration file (history db connection string, download folder location, display name, group and message)
  • Fix for history viewer to show the correct history entries
  • History saved with UTC timestamp
  • Added feature to send screenshots and paste image in message edit box.

This release will now only have revisions with bug fixes. It is feature complete and all new features will go in 3.4.