Configure Tor with Bridge in Ubuntu

sudo apt-get install tor

After runing tor you can see the log of the tor by

journalctl -exft Tor

If the service started without errors, look at the Tor log

sudo journalctl -b --no-pager /usr/bin/tor
sudo apt install obfs4proxy

then you should get the bridge line. for get the bridge line go to and get your bridge line.

nano /etc/tor/torrc
UseBridges 1 
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy 
Bridge obfs4 5C72EEEE587AB1C7021A78707DAB80427F7A9B43 cert=HAZq1DmA4kR1/IFy1TBeSd67BNQI4SDur+U3zxun+G7HCWJ+x66eUyM6/sariPQYDJ9aIw iat-mode=0
Bridge obfs4 6CA77FBE6752502259A3D0079F1C510663166404 cert=yrWZOUqsfQ9IyCj3LFwXSqFqbh+59S+1P9yPh/obHt4fbVYrE3ypGthX/+ZvM207I3xIBQ iat-mode=0
Bridge obfs4 F9DFF618E7BA6C018245D417F39E970C2F019BAA cert=mDZuXuqSTjX1OjN7zLybTYzNi0A21A7G0DRNmW79029cSvLYSOk/KhGftcnmxruTmhRfZQ iat-mode=0
systemctl restart tor.service


Use mongorestore to restore a database to MongoDB with –auth enabled

mongorestore --host databasehost:12345 --username restoreuser --password restorepwd --authenticationDatabase admin --db targetdb ./path/to/dump/
mongorestore --db monitoring --collection items_history_202208 items_history_202208.archive.gz --gzip --archive=items_history_202208.archive.gz --username=user --password=pass --authenticationDatabase=admin


Install GitHub Desktop on Ubuntu

wget -qO - | sudo tee /etc/apt/trusted.gpg.d/shiftkey-desktop.asc > /dev/null
# if you want to use
sudo sh -c 'echo "deb [arch=amd64] any main" > /etc/apt/sources.list.d/packagecloud-shiftkey-desktop.list'

# if you want to use the US mirror
sudo sh -c 'echo "deb [arch=amd64] any main" > /etc/apt/sources.list.d/packagecloud-shiftkey-desktop.list'
sudo apt update && sudo apt install github-desktop


Install GitHub CLI on Ubuntu

curl -fsSL | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
sudo apt update
sudo apt install gh


Child Component Support in Blazor CSS isolation

The CSS isolation is only applied to the component level by default but you can extend it to the child component using “::deep” attribute in the CSS file. This attribute is the Blazor attribute so, it only understands and parses by the Blazor engine. When “::deep” attribute used in the CSS file, the Blazor engine also applied scope identifier to all descendants of components.


<hr />
    paragraph:: This is child component content
    div:: This is child component content
<hr />
@code {


@page "/parentcomponent"
<h3>Parent Component</h3>
    <p>paragraph:: This is Parent Component content</p>
        div:: This is parent component content
@code {


p {
    color: red
::deep div {


Add/Load Components Dynamically in ASP.NET Blazor

@page "/somepage"


  RenderFragment dynamicComponent() => builder =>
        builder.OpenComponent(0, typeof(SurveyPrompt));
        builder.AddAttribute(1, "Title", "Some title");


Get Current URL in a Blazor Component

protected override async Task OnInitializedAsync()
    NavigationManager.LocationChanged += NavigationManagerOnLocationChanged;
    // access to uri on first page load

private void NavigationManagerOnLocationChanged(object? sender, LocationChangedEventArgs e)
    // access to uri on change


Set up Automapper in ASP.NET Core

Add the main AutoMapper Package to your solution via NuGet.

Add the AutoMapper Dependency Injection Package to your solution via NuGet.

Create a new class for a mapping profile. (I made a class in the main solution directory called MappingProfile.cs and add the following code.) I’ll use a User and UserDto object as an example.

public class MappingProfile : Profile {
     public MappingProfile() {
         // Add as many of these lines as you need to map your objects
         CreateMap<User, UserDto>();
         CreateMap<UserDto, User>();

Then add the AutoMapperConfiguration in the Startup.cs as shown below:

public void ConfigureServices(IServiceCollection services) {
    // .... Ignore code before this

   // Auto Mapper Configurations
    var mapperConfig = new MapperConfiguration(mc =>
        mc.AddProfile(new MappingProfile());

    IMapper mapper = mapperConfig.CreateMapper();



To invoke the mapped object in code, do something like the following:

public class UserController : Controller {

    // Create a field to store the mapper object
    private readonly IMapper _mapper;

    // Assign the object in the constructor for dependency injection
    public UserController(IMapper mapper) {
        _mapper = mapper;

    public async Task<IActionResult> Edit(string id) {

        // Instantiate source object
        // (Get it from the database or whatever your code calls for)
        var user = await _context.Users
            .SingleOrDefaultAsync(u => u.Id == id);

        // Instantiate the mapped data transfer object
        // using the mapper you stored in the private field.
        // The type of the source object is the first type argument
        // and the type of the destination is the second.
        // Pass the source object you just instantiated above
        // as the argument to the _mapper.Map<>() method.
        var model = _mapper.Map<UserDto>(user);

        // .... Do whatever you want after that!


Change Access Modifier of .resx to Public in Dot NET

Create resource file.
Edit the .csproj file manually.
Search for the embedded resource tag that includes the *.resx file.
Change Generator child tag content to ‘PublicResXFileCodeGenerator’.
Apply “Move to resource”.

    <EmbeddedResource Update="Resources/Resources.resx">